1
General / Undefined refence to "_imp___ZN2s*****" on build
« on: August 26, 2024, 09:50:39 am »
I have been trying to get SFML to work for the last few hours.
https://en.sfml-dev.org/forums/index.php?topic=13304.0
https://en.sfml-dev.org/forums/index.php?topic=27427.0
These two posts had a similar issue but did not help resolve mine.
c++ code:
I am using VSCode on Windows, with SFML version 2.6.1. I am completely new to using 3rd party c++ libraries so please be understanding. I have tried my best to link the right files but I know I could be at fault here.
https://en.sfml-dev.org/forums/index.php?topic=13304.0
https://en.sfml-dev.org/forums/index.php?topic=27427.0
These two posts had a similar issue but did not help resolve mine.
c++ code:
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
return 0;
}
Build log:int main() {
sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
return 0;
}
C:\MinGW\bin\g++.exe -fdiagnostics-color=always -g "C:\Users\aleki\Documents\UQ\COSC3500 (High Performance Computing)\COSC3500-Flocking\visualiser.cpp" -o "C:\Users\aleki\Documents\UQ\COSC3500 (High Performance Computing)\COSC3500-Flocking\visualiser.exe" -I C:\SFML-2.6.1\include -L C:\SFML-2.6.1\lib -lsfml-graphics -lsfml-window -lsfml-system
C:\Users\aleki\AppData\Local\Temp\cckkE4nr.o: In function `main':
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
collect2.exe: error: ld returned 1 exit status
Build finished with error(s).
C:\Users\aleki\AppData\Local\Temp\cckkE4nr.o: In function `main':
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:/Users/aleki/Documents/UQ/COSC3500 (High Performance Computing)/COSC3500-Flocking/visualiser.cpp:4: undefined reference to `_imp___ZN2sf12RenderWindowD1Ev'
collect2.exe: error: ld returned 1 exit status
Build finished with error(s).
I am using VSCode on Windows, with SFML version 2.6.1. I am completely new to using 3rd party c++ libraries so please be understanding. I have tried my best to link the right files but I know I could be at fault here.