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

Author Topic: undefined reference to `_imp__*`  (Read 6733 times)

0 Members and 1 Guest are viewing this topic.

jucarave

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
undefined reference to `_imp__*`
« on: January 26, 2015, 08:55:26 pm »
Hello there, this is my first message on the forum.

I've been trying to compile a simple code just to test if CSFML works, I'm using CodeBlocks with GNU GCC compiler but it fails in what I believe is when  it tries to link the libraries (?)

this is the output:

mingw32-gcc.exe  -IC:\CLibs\CSFML-2.1\include\ -c C:\PathToMyProject\CSFMLTest\main.c -o obj\Debug\main.o
mingw32-g++.exe -LC:\CLibs\CSFML-2.1\lib\gcc -o bin\Debug\CSFMLTest.exe obj\Debug\main.o   -lcsfml-graphics -lcsfml-window -lcsfml-system
obj\Debug\main.o:main.c:(.text+0x53): undefined reference to `_imp__sfRenderWindow_create'
obj\Debug\main.o:main.c:(.text+0x6f): undefined reference to `_imp__sfCircleShape_create'
obj\Debug\main.o:main.c:(.text+0x7a): undefined reference to `_imp__sfGreen'
obj\Debug\main.o:main.c:(.text+0x8c): undefined reference to `_imp__sfCircleShape_setFillColor'
obj\Debug\main.o:main.c:(.text+0xa4): undefined reference to `_imp__sfRenderWindow_close'
obj\Debug\main.o:main.c:(.text+0xbd): undefined reference to `_imp__sfRenderWindow_pollEvent'
obj\Debug\main.o:main.c:(.text+0xc8): undefined reference to `_imp__sfWhite'
obj\Debug\main.o:main.c:(.text+0xda): undefined reference to `_imp__sfRenderWindow_clear'
obj\Debug\main.o:main.c:(.text+0xf8): undefined reference to `_imp__sfRenderWindow_drawCircleShape'
obj\Debug\main.o:main.c:(.text+0x106): undefined reference to `_imp__sfRenderWindow_display'
obj\Debug\main.o:main.c:(.text+0x114): undefined reference to `_imp__sfRenderWindow_isOpen'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
11 error(s), 0 warning(s) (0 minute(s), 0 second(s))

I just don't understand that part of the _imp__ but searching online I found that the problem is related to the linking order, but I don't know what to do...

Greetings.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: undefined reference to `_imp__*`
« Reply #1 on: January 26, 2015, 10:52:13 pm »
Linking CSFML with a C++ linker was not supported until very recently. You can try to compile the latest sources (or download a nightly build), which may or may not work: CSFML has still not been updated to catch up SFML 2.2.
Laurent Gomila - SFML developer

jucarave

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: undefined reference to `_imp__*`
« Reply #2 on: January 28, 2015, 12:58:13 am »
Ah ok, I compiled the lastest soruces and it worked :D

Thanks

 

anything