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

Author Topic: SFML installation C::B - undefined reference to '__imp___XXXXXX'  (Read 1576 times)

0 Members and 1 Guest are viewing this topic.

bolbozaur

  • Newbie
  • *
  • Posts: 4
    • View Profile
SFML installation C::B - undefined reference to '__imp___XXXXXX'
« on: December 18, 2017, 08:34:30 pm »
Hello.

I just installed SFML and when trying to compile any code I get plenty of
undefined reference to '__imp___ZN2af68...' errors.

So naturally I went to google and it seems like it's common problem. I tried installing SFML again reading installing guide very carefully - same problem.

I'm using Code::Blocks 16.01 with pretty much all default settings (GNU GCC Compiler, seems to be 4.9.2 version according to THIS code I ran) and I downloaded SFML 2.4.2 - GCC 4.9.2 TDM (SJLJ) - 64bit. Also tried downloading SFML 2.4.2 - GCC 6.1.0 MinGW (SEH) - 64bit.

So what have I done step by step is:
1. Download SFML and extract it somewhere. Open C::B and start new empty project.
2. I went to Project Properties -> Project's build options... -> Search Directories and:
    2.1.: -> Compiler: added ...\SFML-2.4.2\include
    2.2.: -> Linker: added ...\SFML-2.4.2\lib


3. Then went to "Release" (from the left menu) -> Linker Settings -> and Added these files:
- ...\SFML-2.4.2\lib\libsfml-system.a
- ...\SFML-2.4.2\lib\libsfml-window.a
- ...\SFML-2.4.2\lib\libsfml-network.a
- ...\SFML-2.4.2\lib\libsfml-audio.a
- ...\SFML-2.4.2\lib\libsfml-graphics.a
4. Then went to "Debuf" (from the left menu) -> Linker Settings -> and Added these files:
- ...\SFML-2.4.2\lib\libsfml-system-d.a
- ...\SFML-2.4.2\lib\libsfml-window-d.a
- ...\SFML-2.4.2\lib\libsfml-network-d.a
- ...\SFML-2.4.2\lib\libsfml-audio-d.a
- ...\SFML-2.4.2\lib\libsfml-graphics-d.a

Also tried adding these files in reverse order.

5. Copied all .dll files from "...\SFML-2.4.2\bin" to the location of .exe file "...\Kurs SFML\bin\Debug".

What did I miss? What did I do wrong? I tried re-doing it over and over from the beginning, yet same result - undefined reference.

I better start questioning my programming capabilities.  ;D

Thank you for any support. :)


« Last Edit: December 18, 2017, 09:00:42 pm by bolbozaur »

bolbozaur

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SFML installation C::B - undefined reference to '__imp___XXXXXX'
« Reply #1 on: December 18, 2017, 09:04:12 pm »
SOLVED!

Seems like my compiler is 32-bit. Downloading 32-bit SFML fixed the problem.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: SFML installation C::B - undefined reference to '__imp___XXXXXX'
« Reply #2 on: December 18, 2017, 09:25:51 pm »
What did I miss?
You certainly missed to provide the full error message. Those aren't just random characters, but those are symbols names which tell you exactly which references it can't find. So what are they? :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/