1
General / Unexpected Errors with SFML in VSCode
« on: May 05, 2023, 06:25:14 pm »
Hello, I'm having errors with building with SFML. For context, I downloaded the most recent 64-bit Visual C++ 15 (2017) version of SFML, and I'm currently using VSCode, with the MinGW compiler. This error occurs whenever I write any line regarding SFML, in this case it's just :
VideoMode vm(1920, 1000);
I'm compiling on the terminal with this command:
g++ src/main.cpp -o main -I"SFML/include" -L"SFML/lib" -lopenal32 -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -o main
and I'm getting this error back:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\shiya\AppData\Local\Temp\cc4H6TOZ.o:main.cpp:(.text+0x28): undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
The compiler seems to recognize all the files I've linked, so I'm unsure as to where this undefined reference is coming from. I've also copied all the dll files from SFML/bin into my project folder. Thanks in advance.
VideoMode vm(1920, 1000);
I'm compiling on the terminal with this command:
g++ src/main.cpp -o main -I"SFML/include" -L"SFML/lib" -lopenal32 -lsfml-graphics -lsfml-audio -lsfml-window -lsfml-system -o main
and I'm getting this error back:
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\shiya\AppData\Local\Temp\cc4H6TOZ.o:main.cpp:(.text+0x28): undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
The compiler seems to recognize all the files I've linked, so I'm unsure as to where this undefined reference is coming from. I've also copied all the dll files from SFML/bin into my project folder. Thanks in advance.