makefile

Started by
3 comments, last by Bregma 9 years, 1 month ago

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

Advertisement

For the benefit of those who come after, those who search for their answer in Google and end up here:

What was your solution?

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.

Stephen M. Webb
Professional Free Software Developer

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

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.

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement