I was trying to compile Jacob1's Mod on Windows 10 x64 with scons and mingw I got this error:
C:\The-Powder-Toy-43.3>scons --win
scons: Reading SConscript files ...
Checking whether the C compiler works... (cached) yes
Checking whether the C++ compiler works... (cached) yes
Checking if 64 bit... no
Adding 32 bit compile flags
Checking for C library mingw32... (cached) yes
Checking for C library ws2_32... (cached) yes
Checking for C library SDL2main... (cached) yes
Checking for C library SDL2... (cached) yes
Checking for C header file SDL2/SDL.h... yes
Checking for C library lua5.1... (cached) yes
Checking for C header file lua5.1/lua.h... yes
Checking for C library fftw3f... (cached) yes
Checking for C library bz2... (cached) yes
Checking for C header file bzlib.h... (cached) yes
Checking for C library z... (cached) yes
Checking for C library curl... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library m... (cached) yes
Checking for C library gnurx... (cached) no
Checking for C library regex... (cached) yes
Checking for C library gdi32... (cached) yes
Checking for C library winmm... (cached) yes
Checking for C library dxguid... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build\src\BSON.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\BSON.cpp
g++ -o build\src\EventLoopSDL.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\EventLoopSDL.cpp
g++ -o build\src\EventLoopSDL1.2.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\EventLoopSDL1.2.cpp
g++ -o build\src\benchmark.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\benchmark.cpp
g++ -o build\src\cJSON.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\cJSON.cpp
g++ -o build\src\console.o -c -std=c++11 -Wno-invalid-offsetof -msse -msse2 -DWIN -D_WIN32_WINNT=0x0501 -D_USING_V110_SDK71_ -DX86 -DX86_SSE -DX86_SSE2 -DGRAVFFT -DLUACONSOLE -Ibuild\src -Isrc -Ibuild\includes -Iincludes src\console.cpp
=====
b'src\\console.cpp: In Funktion \xc2\xbbint console_parse_type(const char*, int*, char*, Simulation*)\xc2\xab:\nsrc\\console.cpp:36:20: Fehler: \xc2\xbbstricmp\xc2\xab wurde in diesem G\xc3\xbcltigkeitsbereich nicht definiert\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:45:7: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (!strcasecmp(txt, "C4"))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Anmerkung: empfohlene Alternative: \xc2\xbbstrncmp\xc2\xab\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:45:7: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (!strcasecmp(txt, "C4"))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Fehler: \xc2\xbbstricmp\xc2\xab wurde in diesem G\xc3\xbcltigkeitsbereich nicht definiert\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:57:60: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if ((i > 0 && i < PT_NUM && sim->elements[i].Enabled) || !strcasecmp(txt, "NONE") || !strcasecmp(txt, "0"))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Anmerkung: empfohlene Alternative: \xc2\xbbstrncmp\xc2\xab\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:57:60: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if ((i > 0 && i < PT_NUM && sim->elements[i].Enabled) || !strcasecmp(txt, "NONE") || !strcasecmp(txt, "0"))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Fehler: \xc2\xbbstricmp\xc2\xab wurde in diesem G\xc3\xbcltigkeitsbereich nicht definiert\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:65:8: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (!strcasecmp(txt, sim->elements[i].Name.c_str()) && (sim->elements[i].Enabled || secret_els))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Anmerkung: empfohlene Alternative: \xc2\xbbstrncmp\xc2\xab\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:65:8: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (!strcasecmp(txt, sim->elements[i].Name.c_str()) && (sim->elements[i].Enabled || secret_els))\n ^~~~~~~~~~\nsrc\\console.cpp: In Funktion \xc2\xbbint console_parse_wall_type(const char*, int*)\xc2\xab:\nsrc\\console.cpp:36:20: Fehler: \xc2\xbbstricmp\xc2\xab wurde in diesem G\xc3\xbcltigkeitsbereich nicht definiert\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:80:7: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (strcasecmp(txt,wallTypes[i].name.c_str())==0 && (wallTypes[i].drawstyle != -1 || secret_els))\n ^~~~~~~~~~\nsrc\\console.cpp:36:20: Anmerkung: empfohlene Alternative: \xc2\xbbstrncmp\xc2\xab\n #define strcasecmp stricmp\n ^~~~~~~\nsrc\\console.cpp:80:7: Anmerkung: bei Substitution des Makros \xc2\xbbstrcasecmp\xc2\xab\n if (strcasecmp(txt,wallTypes[i].name.c_str())==0 && (wallTypes[i].drawstyle != -1 || secret_els))\n ^~~~~~~~~~\n'
=====
scons: *** [build\src\console.o] Error 1
scons: building terminated because of errors.
strip: 'build/Powder.exe': No such file
Thanks in advance
jacob1:
What version of visual studio are you using?
I'm using strcasecmp, which isn't part of the standard library. At the top of console.cpp it gets defined as either _stricmp or stricmp, which visual studio usually defines and works the same way.
Edit: oh, not visual studio. One of the defines made me think it was. I do recommend visual studio. If you don't want to, I do need to know which version of mingw you are using. Is it the one recommended in the wiki? Or a more recent one like mingw-w64
Im using
Thanks for answering that quickly, does it have any effect if im not using visual studios ? And how can I fix that, or should I switch to vs or mingw-w64 ?
jacob1:
I'm trying to set up a new compiler (mingw-w64), maybe will have more luck tomorrow. Then I'll be able to test this. Right now I only test msvc (which does work with scons, btw, using the --msvc flag).
Sometime late tomorrow I'll probably just update the code to remove references to this function. Should be easy to write my own.
Okay thanks, with the msvc flag it cant find the sdl library how should i install it? I never done anything in vs.
jacob1:
You'd need to follow the visual studio guide: https://powdertoy.co.uk/Wiki/W/Compiling_tpt%2B%2B_with_Visual_studio.html
But if you still want to use scons (for use in other IDEs), you can ignore almost all of it.
Just download visual studio and install it: https://www.visualstudio.com/downloads/
Then download the visual studio libraries I compiled and put them next to the source code: https://starcatcher.us/TPT/Required%20Libraries.zip
Sounds like you might already have visual studio installed, you just need to download those libraries.
Thank you very much sir it's compiling fine now ^^ So the problem is solved