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

Author Topic: Problem linking SFML 2.4 : skipping incompatible  (Read 5279 times)

0 Members and 1 Guest are viewing this topic.

thecheeselover

  • Newbie
  • *
  • Posts: 24
    • View Profile
Problem linking SFML 2.4 : skipping incompatible
« on: December 30, 2016, 07:05:06 am »
OS : Windows 7 64 bits
IDE : Code::Blocks 16.01
Compiler : MinGW w64 gcc 6.2

I'm trying to make an SFML 2.4 template in 64 bits. I successfully generated the and built SFML 2.4 from the source. I tried two different builds : one with gcc / g++ and the other one with i686-w64-mingw32-gcc / i686-w64-mingw32-g++.

My reasons for doing so is that I get this message in the build log : skipping incompatible .../libsfml-system-s.a when searching for sfml-system-s and other libraries. My IDE cannot find the sfml librairies and also fails to find glews32 (the later seems to be a different problem, as it does not have the same comment in the build log).

It seems that my 64 bits compiler compiles in 32 bits the sfml libraries. In Code::Blocks, I have to check the option "Target x86_64 (64bit) [-m64]" but I do not have this option while specifying the native compiler in cmake.

Could you help me please? :)
Thanks

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 878
    • View Profile
Re: Problem linking SFML 2.4 : skipping incompatible
« Reply #1 on: December 30, 2016, 08:54:51 am »
This sounds a lot like your linker is somehow finding a very old and outdated version of the library, because the latest 2.4 shouldn't use GLEW anymore. Have you tried linking with "-v" so you can see what it tries to link?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Problem linking SFML 2.4 : skipping incompatible
« Reply #2 on: December 30, 2016, 08:56:51 am »
i686 indicates that you're using a 32-bit compiler. The compiler family is called MinGW-w64, but they offer both 32 and 64-bit compilers.
So if you use a 32-bit compiler and try to link 64-bit SFML libraries it won't work.

Not exactly sure why you're mentioning GLEW, since SFML doesn't use GLEW anymore.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

thecheeselover

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Problem linking SFML 2.4 : skipping incompatible
« Reply #3 on: December 30, 2016, 05:24:16 pm »
This sounds a lot like your linker is somehow finding a very old and outdated version of the library, because the latest 2.4 shouldn't use GLEW anymore. Have you tried linking with "-v" so you can see what it tries to link?

Oops, my bad ahah. I linked glew by habit.

i686 indicates that you're using a 32-bit compiler. The compiler family is called MinGW-w64, but they offer both 32 and 64-bit compilers.
So if you use a 32-bit compiler and try to link 64-bit SFML libraries it won't work.

Ok so the default gcc/g++ compilers were the 64 bits one.

Here's something I find weird : Code::Blocks uses ld.exe which is in the i686-w64-mingw32/bin folder instead of using ld.exe which is in bin/ld.exe... Look at the full log :

"D:/Compilers/MinGW/W64/x86_64-6.2.0-posix-sjlj-rt_v5-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/6.2.0/../../../../i686-w64-mingw32/bin/ld.exe: skipping incompatible D:\CodeBlocks Workspace\Do not touch\Librairies\SFML binaries\SFML-2.4.1\MinGW w64 gcc 6.2\Release\lib/libsfml-window-s.a when searching for -lsfml-window-s"

As eXpl0it3r said, i686 is 32 bit. Why does Code::Blocks move around twice to go find a 32 bit version of ld.exe when he's by default directly in the bin directory where everything is contained there in 64 bit?
« Last Edit: December 30, 2016, 05:39:06 pm by thecheeselover »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10815
    • View Profile
    • development blog
    • Email
Problem linking SFML 2.4 : skipping incompatible
« Reply #4 on: December 30, 2016, 06:46:05 pm »
Code::Blocks uses the linker that has been specified in the global compiler configuration. What I ask myself though, is whether you've added those 32-bit binaries or whether the compiler came with those already?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

thecheeselover

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: Problem linking SFML 2.4 : skipping incompatible
« Reply #5 on: December 30, 2016, 10:25:21 pm »
Code::Blocks uses the linker that has been specified in the global compiler configuration. What I ask myself though, is whether you've added those 32-bit binaries or whether the compiler came with those already?

I installed the compiler and it is 64 and 32 bit capable. I do not know why Code::Blocks go for the 32 bit executable when the 64 bit executable is directly under his nose.

I figured soemthing out! I executed te command "objdump -f libsfml-system-s.a | grep ^architecture" and i386 printed, which means the libraries are 32 bit.

Yeah! I fixed the problem! :D Gosh I love this linux command "objdump -f libsfml-system-s.a | grep ^architecture". With this, I figured out that my MinGW w64 gcc 6.2 compiler was by default 32 bit. As sfml's cmake configuration doesn't support arguments for the compiler, I download the newest version of the compiler which is by surprise 64 bit by default.

Thanks everybody for the help! :)
« Last Edit: December 31, 2016, 02:14:36 am by thecheeselover »

 

anything