Hello!
I've just finished installing SFML using the tutorial on the Wiki, and I've tried to run the code posted at the end of the tutorial. After clicking build, the error log throws this in my face;
obj\Debug\main.o||In function `main':|
N:\Programming\C++\Projects\test-sfml\main.cpp|5|undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'|
N:\Programming\C++\Projects\test-sfml\main.cpp|5|undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'|
N:\Programming\C++\Projects\test-sfml\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|6|undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'|
N:\Programming\C++\Projects\test-sfml\main.cpp|7|undefined reference to `_imp___ZN2sf5Color5GreenE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|7|undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|15|undefined reference to `_imp___ZN2sf6Window5closeEv'|
N:\Programming\C++\Projects\test-sfml\main.cpp|12|undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|18|undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'|
N:\Programming\C++\Projects\test-sfml\main.cpp|18|undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|19|undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'|
N:\Programming\C++\Projects\test-sfml\main.cpp|20|undefined reference to `_imp___ZN2sf6Window7displayEv'|
N:\Programming\C++\Projects\test-sfml\main.cpp|9|undefined reference to `_imp___ZNK2sf6Window6isOpenEv'|
N:\Programming\C++\Projects\test-sfml\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
N:\Programming\C++\Projects\test-sfml\main.cpp|5|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
N:\Programming\C++\Projects\test-sfml\main.cpp|23|undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'|
obj\Debug\main.o||In function `ZN2sf11CircleShapeD1Ev':|
C:\SFML\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZTVN2sf11CircleShapeE'|
C:\SFML\include\SFML\Graphics\CircleShape.hpp|41|undefined reference to `_imp___ZN2sf5ShapeD2Ev'|
||=== Build finished: 20 errors, 0 warnings (0 minutes, 1 seconds) ===|
I have no idea what to do, a Google search appears with next to no results and I tried searching these forums but got a database error (just my luck!)
Information; running SFML 2.1 on Code::Blocks, and I'm using Windows 7. I've tried changing from the Code::Blocks MinGW to a full MinGW install directory but still nothing.
Any help?
Follow this: http://en.sfml-dev.org/forums/index.php?topic=12552.0
Rebuild your project (not just build) and paste the complete output here.
-------------- Clean: Debug in test-sfml (compiler: GNU GCC Compiler)---------------
Cleaned "test-sfml - Debug"
-------------- Build: Debug in test-sfml (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -g -IC:\SFML-2.1\include -c N:\Programming\C++\Projects\test-sfml\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\SFML-2.1\lib -o bin\Debug\test-sfml.exe obj\Debug\main.o -lsfml-network-d -lsfml-audio-d -lsfml-graphics-d -lsfml-window-d -lsfml-system-d -lopengl32
obj\Debug\main.o: In function `main':
N:/Programming/C++/Projects/test-sfml/main.cpp:5: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
N:/Programming/C++/Projects/test-sfml/main.cpp:5: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
N:/Programming/C++/Projects/test-sfml/main.cpp:5: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
N:/Programming/C++/Projects/test-sfml/main.cpp:6: undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
N:/Programming/C++/Projects/test-sfml/main.cpp:7: undefined reference to `_imp___ZN2sf5Color5GreenE'
N:/Programming/C++/Projects/test-sfml/main.cpp:7: undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
N:/Programming/C++/Projects/test-sfml/main.cpp:15: undefined reference to `_imp___ZN2sf6Window5closeEv'
N:/Programming/C++/Projects/test-sfml/main.cpp:12: undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
N:/Programming/C++/Projects/test-sfml/main.cpp:18: undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
N:/Programming/C++/Projects/test-sfml/main.cpp:18: undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
N:/Programming/C++/Projects/test-sfml/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
N:/Programming/C++/Projects/test-sfml/main.cpp:19: undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
N:/Programming/C++/Projects/test-sfml/main.cpp:20: undefined reference to `_imp___ZN2sf6Window7displayEv'
N:/Programming/C++/Projects/test-sfml/main.cpp:9: undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
N:/Programming/C++/Projects/test-sfml/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
N:/Programming/C++/Projects/test-sfml/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
N:/Programming/C++/Projects/test-sfml/main.cpp:23: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:/SFML-2.1/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `_imp___ZN2sf5ShapeD2Ev'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 2 seconds)
20 errors, 0 warnings (0 minutes, 2 seconds)
-SNIP-
I tried this, resulted in the same error messages. Thanks anyway.