Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Installing SFML : "Undefined reference"  (Read 924 times)

0 Members and 1 Guest are viewing this topic.

aqwplm

  • Newbie
  • *
  • Posts: 1
    • View Profile
Installing SFML : "Undefined reference"
« on: November 23, 2020, 10:42:35 pm »
So this question has probably been asked a lot, but after looking for a whole day to try and fix the problem, i'm desperate enough to ask the question here.
I have compiled SFML with  CMake, and followed the tutorial to be able to use SFML with my version of MinGW (mingw32 9.2.0).
(I have previously tried uninstalling my version of MinGW to install MinGW 7.3 instead and use the provided already compiled package but this didn't work for other reason)

I then installed the compiled version i obtained in the MinGW folder, as per this tutorial : )
(I put the compiled lib into C:\MinGW\lib\gcc\mingw32\9.2.0 and the compiled include in C:\MinGW\lib\gcc\mingw32\9.2.0\include\c++)

I then created a folder and opened it in VSCode.
Wrote a very basic SFML program. The IDE seemed to recognize the SFML file and allow me using IntelliSense to use auto-complete.
I also copied the .dll into thus same folder.
Unfortunately, when i compiled using mingw32-g++ [namefile] -o [outputname] -lsfml-graphics -lsfml-window -lsfml-system i get a bunch of errors.
All those errors are in this format :

c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\[MY NAME]\AppData\Local\Temp\ccReepzx.o:main.cpp:(.text+0x7c): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'

I've tried a lot of solutions, including using the default provided version of sfml (Which unsurprisingly didn't work), re installing MinGW multiple times, installing it different ways, different versions, but nothing seem to work.

I can try and provide more explainations to my problems if needed to help me.
I'm beginning to feel kinda hopeless about this to be honest and would really appreciate any help. I've tried googling unfortunately found absolutely nothing.