i keep getting an error when trying to compile with scons on windows 7
i got 2 different errors first one was resolved after updating some things in msys, second one (below) i havent managed to find a solution to
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build\src\PowderToySDL.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DSDL_INC -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -DUSE_SDL -Ibuild\src -Isrc -Ibuild\data -Idata -Ibuild\generated -Igenerated src\PowderToySDL.cpp
=====
b'In file included from src\\client/requestbroker/RequestBroker.h:7:0,\r\n from src\\client/Client.h:16,\r\n from src\\PowderToySDL.cpp:47:\r\nsrc/common/tpt-thread.h:16:21: fatal error: pthread.h: No such file or directory\r\n #include <pthread.h>\r\n ^\r\ncompilation terminated.\r\n'
=====
scons: *** [build\src\PowderToySDL.o] Error 1
scons: building terminated because of errors.
strip: 'build/Powder.exe': No such file
edit: seems to compile now,
Call Jacob1 to get help how to fix these errors.
yes i got all the needed librarys listed in the guide, pthreads seems to have gotten glitched after i ran "mingw-get update && mingw-get upgrade" to try and fix my first issue anyways i manually found and downloaded pthreads and that issue is gone, now its back to the first one i had
=====
b"In file included from c:\\mingw\\include\\direct.h:34:0,\r\n from src\\PowderToySDL.cpp:9:\r\nc:\\mingw\\include\\io.h:301:14: error: 'off64_t' does not name a type\r\n __CRT_INLINE off64_t lseek64 (int, off64_t, int);\r\n ^~~~~~~\r\nc:\\mingw\\include\\io.h:302:14: error: 'off64_t' does not name a type\r\n __CRT_INLINE off64_t lseek64 (int fd, off64_t offset, int whence) {\r\n ^~~~~~~\r\n"
=====
scons: *** [build\src\PowderToySDL.o] Error 1
scons: building terminated because of errors.
it appears to be an issue with mingw itself this time though,
i am downloading msys2 to see if i can find a fix through that
i got past that error by changing 2 lines of code in io.h and now for the next error
=====
b"src\\lua\\LuaScriptInterface.cpp: In static member function 'static int LuaScriptInterface::elements_allocate(lua_State*)':\r\nsrc\\lua\\LuaScriptInterface.cpp:2560:66: error: 'strdup' was not declared in this scope\r\n luacon_sim->elements[i].Identifier = strdup(identifier.c_str());\r\n ^\r\nsrc\\lua\\LuaScriptInterface.cpp:2574:67: error: 'strdup' was not declared in this scope\r\n luacon_sim->elements[i].Identifier = strdup(identifier.c_str());\r\n ^\r\n"
=====
scons: *** [build\src\lua\LuaScriptInterface.o] Error 1
scons: building terminated because of errors.
strip: 'build/Powder.exe': No such file
windows development really hates me right now
(this is not the first time i tried to compile something on windows and got stuck in error hell)
next post:
previous error seems to have been solved, next error
=====
b'src\\lua\\TPTScriptInterface.cpp: In member function \'AnyType TPTScriptInterface::tptS_set(std::deque<String>*)\':\r\nsrc\\lua\\TPTScriptInterface.cpp:283:72: error: \'stricmp\' was not declared in this scope\r\n if (!strcasecmp(((StringType)value).Value().ToUtf8().c_str(),"cake"))\r\n ^\r\n'
=====
scons: *** [build\src\lua\TPTScriptInterface.o] Error 1
scons: building terminated because of errors.
strip: 'build/Powder.exe': No such file
edit :
removed that error by commenting out some code in /lua/TPTScriptInterface.cpp on lines 283 284 and 285
next error:
=====
b'src\\simulation\\Simulation.cpp: In member function \'int Simulation::GetParticleType(ByteString)\':\r\nsrc\\simulation\\Simulation.cpp:4903:27: error: \'stricmp\' was not declared in this scope\r\n if (!strcasecmp(txt, "C4"))\r\n ^\r\nsrc\\simulation\\Simulation.cpp:4911:48: error: \'stricmp\' was not declared in this scope\r\n if (!strcasecmp(txt, elements[i].Name.c_str()) && elements[i].Name.size() && elements[i].Enabled)\r\n ^\r\n'
=====
scons: *** [build\src\simulation\Simulation.o] Error 1
scons: building terminated because of errors.
at this point i am wondering if i should still be posting the errors here
i got further but it still doesn't like me,
(error is too long for a forum post this time)
edit: issue was with pthreads (again) i fixed it by reinstalling mingw.
i succesfully got it to compile