1
General / Re: i got errors at compilation
« on: November 07, 2023, 09:55:28 pm »
I linked libraries as stated in the tutorial (lib prefix and .a extensions omited) and this is what i got :
-------------- Build: Debug in sfml (compiler: GNU GCC Compiler)---------------
g++.exe -LC:\Users\asus\Documents\SFML\SFML-2.6.1\lib -o bin\Debug\sfml.exe obj\Debug\lucru.o C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-graphics C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-window C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-system
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-graphics: No such file or directory
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-window: No such file or directory
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-system: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
if i put the prefix and the .a extensions i got this :
-------------- Build: Debug in sfml (compiler: GNU GCC Compiler)---------------
g++.exe -LC:\Users\asus\Documents\SFML\SFML-2.6.1\lib -o bin\Debug\sfml.exe obj\Debug\lucru.o C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-graphics.a C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-window.a C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-system.a
obj\Debug\lucru.o: In function `main':
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:6: undefined reference to `__imp__ZN2sf11CircleShapeC1Efy'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:7: undefined reference to `__imp__ZN2sf5Color5GreenE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:7: undefined reference to `__imp__ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:9: undefined reference to `__imp__ZNK2sf10WindowBase6isOpenEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:12: undefined reference to `__imp__ZN2sf10WindowBase9pollEventERNS_5EventE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:15: undefined reference to `__imp__ZN2sf6Window5closeEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:18: undefined reference to `__imp__ZN2sf5ColorC1Ehhhh'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:18: undefined reference to `__imp__ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:19: undefined reference to `__imp__ZN2sf12RenderStates7DefaultE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:19: undefined reference to `__imp__ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:20: undefined reference to `__imp__ZN2sf6Window7displayEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
obj\Debug\lucru.o: In function `sf::CircleShape::~CircleShape()':
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/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 minute(s), 0 second(s))
20 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-------------- Build: Debug in sfml (compiler: GNU GCC Compiler)---------------
g++.exe -LC:\Users\asus\Documents\SFML\SFML-2.6.1\lib -o bin\Debug\sfml.exe obj\Debug\lucru.o C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-graphics C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-window C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-system
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-graphics: No such file or directory
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-window: No such file or directory
g++.exe: error: C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\sfml-system: No such file or directory
Process terminated with status 1 (0 minute(s), 0 second(s))
3 error(s), 0 warning(s) (0 minute(s), 0 second(s))
if i put the prefix and the .a extensions i got this :
-------------- Build: Debug in sfml (compiler: GNU GCC Compiler)---------------
g++.exe -LC:\Users\asus\Documents\SFML\SFML-2.6.1\lib -o bin\Debug\sfml.exe obj\Debug\lucru.o C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-graphics.a C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-window.a C:\Users\asus\Documents\SFML\SFML-2.6.1\lib\libsfml-system.a
obj\Debug\lucru.o: In function `main':
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf9VideoModeC1Ejjj'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:6: undefined reference to `__imp__ZN2sf11CircleShapeC1Efy'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:7: undefined reference to `__imp__ZN2sf5Color5GreenE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:7: undefined reference to `__imp__ZN2sf5Shape12setFillColorERKNS_5ColorE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:9: undefined reference to `__imp__ZNK2sf10WindowBase6isOpenEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:12: undefined reference to `__imp__ZN2sf10WindowBase9pollEventERNS_5EventE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:15: undefined reference to `__imp__ZN2sf6Window5closeEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:18: undefined reference to `__imp__ZN2sf5ColorC1Ehhhh'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:18: undefined reference to `__imp__ZN2sf12RenderTarget5clearERKNS_5ColorE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:19: undefined reference to `__imp__ZN2sf12RenderStates7DefaultE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:19: undefined reference to `__imp__ZN2sf12RenderTarget4drawERKNS_8DrawableERKNS_12RenderStatesE'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:20: undefined reference to `__imp__ZN2sf6Window7displayEv'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
C:/Users/asus/Desktop/C++/sfml/lucru.cpp:5: undefined reference to `__imp__ZN2sf12RenderWindowD1Ev'
obj\Debug\lucru.o: In function `sf::CircleShape::~CircleShape()':
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `__imp__ZTVN2sf11CircleShapeE'
C:/Users/asus/Downloads/SFML-2.6.0-windows-vc17-32-bit (1)/SFML-2.6.0/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 minute(s), 0 second(s))
20 error(s), 0 warning(s) (0 minute(s), 0 second(s))