Jump to content
  • Advertisement
Sign in to follow this  
FGFS

makefile

This topic is 1260 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

PS: SOLVED but can't delete this post.

 

 

Hi

I try to compile a makefile based project and get:

/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
/usr/bin/ld: cannot find -lSOIL32
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/libGL.so when searching for -lGL
/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lluajit-5.1

 

I guess I need to tell to compile for x64? Probably I need to change this line below?

 

# release options
RELEASE_CXXFLAGS=-O3 -ffast-math -march=i686 -msse
RELEASE_LNFLAGS=

 

 

Thanks

 

 

Edited by FGFS

Share this post


Link to post
Share on other sites
Advertisement

Hint: you're building a 32-bit executable on a 64-bit Debian-based system, you'll want to install the multi-arch 32-bit dev package.

Share this post


Link to post
Share on other sites

I only needed to change those two settings. Sorry I hardly ever used makefiles before:

 

# release options
RELEASE_CXXFLAGS=-O3 -ffast-math -march=x86-64 -msse

 

 

ifneq ($(BUILD_64),yes)
#CXXFLAGS+=-m32
#LNFLAGS+=-m32 -L/usr/lib32
CXXFLAGS+=-m64
LNFLAGS+=-m64 -L/usr/lib/x86_64-linux-gnu/
endif
 

Share this post


Link to post
Share on other sites

You only need to force the toolchain to build for an x86_64 target if you're not on an x86_64 host (ie. you're cross building).  It's probably much simpler to just remove the -march flag from the compiler command than to keep adding more cross-building flags to other parts of the toolchain in order to get a native build.

 

I imagine the -march=i686 was added to the original Makefile to prevent builds for Pentium II or earlier CPUs which did not support certain faster instructions.  The x86_64 architecture does not need to be restricted to processors available only in the last decades since all of them quallfy in that respect.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!