1
General / collect2.exe: error: ld returned 1 exit status
« on: January 21, 2019, 09:16:35 pm »
This is my first post!
Whenever I try to run the sfml tutorial program i get this error
I am using the command g++ main.cpp -I C:\SFML-2.5.1\include\
I am running Windows 10 64-bit and am using SFML 2.5.1
Whenever I try to run the sfml tutorial program i get this error
(click to show/hide)
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0xa2): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0xde): undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x115): undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x126): undefined reference to `_imp___ZN2sf5Color5GreenE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x130): undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x142): undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x162): undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x182): undefined reference to `_imp___ZN2sf6Window5closeEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1af): undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1ca): undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1dd): undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1f1): undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x203): undefined reference to `_imp___ZN2sf6Window7displayEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x229): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x273): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0xa): undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x17): undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x2a): undefined reference to `_imp___ZN2sf5ShapeD2Ev'
collect2.exe: error: ld returned 1 exit status
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0xa2): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0xde): undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x115): undefined reference to `_imp___ZN2sf11CircleShapeC1Efj'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x126): undefined reference to `_imp___ZN2sf5Color5GreenE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x130): undefined reference to `_imp___ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x142): undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x162): undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x182): undefined reference to `_imp___ZN2sf6Window5closeEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1af): undefined reference to `_imp___ZN2sf5ColorC1Ehhhh'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1ca): undefined reference to `_imp___ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1dd): undefined reference to `_imp___ZN2sf12RenderStates7DefaultE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x1f1): undefined reference to `_imp___ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x203): undefined reference to `_imp___ZN2sf6Window7displayEv'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x229): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text+0x273): undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0xa): undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x17): undefined reference to `_imp___ZTVN2sf11CircleShapeE'
C:\Users\Sam\AppData\Local\Temp\ccZHNA5v.o:main.cpp:(.text$_ZN2sf11CircleShapeD1Ev[__ZN2sf11CircleShapeD1Ev]+0x2a): undefined reference to `_imp___ZN2sf5ShapeD2Ev'
collect2.exe: error: ld returned 1 exit status
I am using the command g++ main.cpp -I C:\SFML-2.5.1\include\
I am running Windows 10 64-bit and am using SFML 2.5.1