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

Author Topic: Undefined reference to  (Read 2543 times)

0 Members and 1 Guest are viewing this topic.

help_me

  • Newbie
  • *
  • Posts: 2
    • View Profile
Undefined reference to
« on: June 05, 2021, 05:14:19 pm »
My mingw version is 6.3.0-1
SFML version is 2.5.1 vc15 64 bit
My os is windows 10 64 bit

When i am in linux i can easily run sfml with https://stackoverflow.com/questions/48367503/undefined-reference-when-using-sfml that solution

But in windows no matter what I do, no matter how much I research, I always get stuck on this error. I know these questions have been asked before, but I researched too much and still can't figure it out. so please don't be angry

i am using that command: g++ app.cpp -o test  -I C:\SFML\include -L C:\SFML\lib -lsfml-graphics -lsfml-window -lsfml-system

and result is just like that:

C:\Users\AppData\Local\Temp\ccUI5DvS.o:app.cpp:(.text+0x7f): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:\Users\AppData\Local\Temp\ccUI5DvS.o:app.cpp:(.text+0xa5): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:\Users\AppData\Local\Temp\ccUI5DvS.o:app.cpp:(.text+0xe4): undefined reference to `_imp___ZN2sf12RenderWindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'

(Probably this output will not help you much, so I threw it short, otherwise it continues longer like this.)

Please help me. I just want to run sfml without any ide like in linux
« Last Edit: June 05, 2021, 05:18:38 pm by help_me »

kojack

  • Sr. Member
  • ****
  • Posts: 343
  • C++/C# game dev teacher.
    • View Profile
Re: Undefined reference to
« Reply #1 on: June 05, 2021, 05:34:32 pm »
I saw on reddit that these errors will come from using the wrong SFML for your compiler.
From your top lines, looks like you are trying to use the Visual Studio 2017 (VC15) version of SFML with MingW (which is GCC, not Visual Studio). So you need to download the GCC version of SFML.

At least from what I just read, been many years since I used MingW for ARM development. :)

help_me

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Undefined reference to
« Reply #2 on: June 05, 2021, 06:50:10 pm »
I installed mingw 7.3.0 and downloaded sfml mingw which is you said... AND YESSSS IT WORKED THANK YOU SO MUCH

(when i try to run compiled file it says dll missing error so i copied dll files to compiled file directory it worked)

 

anything