Jump to content
funtoo forums
  • 0
onli

sdl2-image needs LDFLAG="-lm"

Question

That's more a questions whether someone can confirm it's a bug and I should report it somewhere else. When emerging media-libs/sdl2-image I got this error:

libtool: link: x86_64-pc-linux-gnu-gcc -m32 -I/usr/include/libpng16 -march=native -O1 -pipe -I/usr/include/SDL2 -D_REENTRANT -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -o .libs/showimage showimage.o  ./.libs/libSDL2_image.so -lpng16 -ljpeg -ltiff -lz -lwebp -lSDL2
./.libs/libSDL2_image.so: error: undefined reference to 'sqrtf'
./.libs/libSDL2_image.so: error: undefined reference to 'sincosf'
./.libs/libSDL2_image.so: error: undefined reference to 'floorf'
./.libs/libSDL2_image.so: error: undefined reference to 'acosf'
./.libs/libSDL2_image.so: error: undefined reference to 'ceilf'
./.libs/libSDL2_image.so: error: undefined reference to 'atan2f'
./.libs/libSDL2_image.so: error: undefined reference to 'sqrt'
./.libs/libSDL2_image.so: error: undefined reference to 'pow'
./.libs/libSDL2_image.so: error: undefined reference to 'tanf'
./.libs/libSDL2_image.so: error: undefined reference to 'fmodf'
collect2: error: ld returned 1 exit status
make: *** [Makefile:550: showimage] Error 1
 * ERROR: media-libs/sdl2-image-2.0.2::media-kit failed (compile phase):
 *   emake failed

After a lot of searching I realized the linker is missing the lm flag:

sudo LDFLAGS="-lm"  emerge media-libs/sdl2-image

That way it compiled successfully.

Is that somehow specific to my system?

Share this post


Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×