complation errors

  • DustinVille
    9th May 2018 Member 0 Permalink

    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,

    Edited once by DustinVille. Last: 11th May 2018
  • PangeaUltima
    9th May 2018 Member 0 Permalink

    Call Jacob1 to get help how to fix these errors.

  • jacob1
    9th May 2018 Developer 0 Permalink
    Did you complete the steps in " Getting Needed Libraries"? You don't seem to have pthreads installed

    Anyway, that guide probably doesn't work anymore. I would suggest using the Visual studio guide

    Maybe some day I'll update the MinGW guide ... it's probably pretty close to working, maybe you could figure it out.
  • DustinVille
    10th May 2018 Member 0 Permalink

    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

  • jacob1
    10th May 2018 Developer 0 Permalink
    Yeah, most people who use mingw run into issues with mingw itself. The download linked to in the guide isn't supported, and has barely been updated in years. I think there's a newer mingw (mingw-w64?). I haven't looked into it much.
  • DustinVille
    10th May 2018 Member 0 Permalink

    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

    Edited 3 times by DustinVille. Last: 10th May 2018
  • mniip
    10th May 2018 Developer 0 Permalink
    I've added a compilation flag to SConscript that should tell mingw not to try too hard to be standards-compliant. I've verified that it now works on my VM. You could try now perhaps.

    (Also generally changing the installed system headers is something you shouldn't do at any cost. I suggest you reinstall the gcc/g++ package via mingw-get)
    Edited once by mniip. Last: 10th May 2018
  • DustinVille
    11th May 2018 Member 0 Permalink

    i got further but it still doesn't like me,

     

    https://pastebin.com/t9jpUdBc

    (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

    Edited once by DustinVille. Last: 11th May 2018