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

Author Topic: Cannot set up SFML on Dev C++  (Read 3942 times)

0 Members and 1 Guest are viewing this topic.

CppGuy123

  • Newbie
  • *
  • Posts: 3
    • View Profile
Cannot set up SFML on Dev C++
« on: June 22, 2015, 04:46:30 pm »
Hello,so i have been getting errors when running SFML on Dev C++,I've done everything correctly(i think)
I downloaded x32 GCC SJLJ version and I've checked if my MinGW had SJLJ or DW2,and my OS is Windows and it  is x32 bit.
I've put every file that was in archive at correct place(lib,include and bin),and linked library files in project options,but every time i try to run program i get this kind of error(last two lines are always same in case,but "undefined reference to" errors are different(depending what elements do i use):
Code: [Select]
C:\Users\user\Desktop\main.o main.cpp:(.text+0x127): undefined reference to `_imp___ZN2sf6StringC1EPKcRKSt6locale'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x157): undefined reference to `_imp___ZN2sf9VideoModeC1Ejjj'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x19a): undefined reference to `_imp___ZN2sf6WindowC1ENS_9VideoModeERKNS_6StringEjRKNS_15ContextSettingsE'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x1d2): undefined reference to `_imp___ZN2sf6Window5closeEv'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x1ee): undefined reference to `_imp___ZN2sf6Window9pollEventERNS_5EventE'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x20b): undefined reference to `_imp___ZNK2sf6Window6isOpenEv'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x225): undefined reference to `_imp___ZN2sf6WindowD1Ev'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x279): undefined reference to `_imp___ZN2sf6WindowD1Ev'
C:\Users\user\Desktop\main.o main.cpp:(.text+0x2f8): undefined reference to `_imp___ZN2sf6WindowD1Ev'
C:\Users\user\Desktop\collect2.exe [Error] ld returned 1 exit status
25 C:\Users\user\Desktop\Makefile.win recipe for target 'SFML.exe' failed
no program runs which has SFML elements...
Can anyone help me?I'm using Dev C++ 5.11,and use static libraries
« Last Edit: June 22, 2015, 04:55:42 pm by CppGuy123 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Cannot set up SFML on Dev C++
« Reply #1 on: June 22, 2015, 04:57:28 pm »
You need to define SFML_STATIC in the project option if you link the static libraries.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

CppGuy123

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cannot set up SFML on Dev C++
« Reply #2 on: June 22, 2015, 05:01:59 pm »
You need to define SFML_STATIC in the project option if you link the static libraries.
I've done that,still get same error

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Cannot set up SFML on Dev C++
« Reply #3 on: June 22, 2015, 05:04:49 pm »
Well you haven't done it at the right place them. Because if the STATIC_SFML was applied properly, the error wouldn't have any "_imp__" (which stands for import, which means import from shared libs) in it. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

kitteh-warrior

  • Guest
Re: Cannot set up SFML on Dev C++
« Reply #4 on: June 22, 2015, 05:11:48 pm »
It is also possible that you didn't link SFML's dependencies.

CppGuy123

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Cannot set up SFML on Dev C++
« Reply #5 on: June 22, 2015, 05:19:27 pm »
It is also possible that you didn't link SFML's dependencies.
Nope,i did link them
Well you haven't done it at the right place them. Because if the STATIC_SFML was applied properly, the error wouldn't have any "_imp__" (which stands for import, which means import from shared libs) in it. ;)
Oh,I defined STATIC_SFML at file itself,because i couldn't find place to define it in Project options,does anyone know where is it supposed to be defined in dev c++?

EDIT:
I fixed it :D Thanks for help!
« Last Edit: June 22, 2015, 05:34:22 pm by CppGuy123 »

 

anything