can't find libm

Forum thread started by farvardin on Thu, 2010-05-20 22:11

Hello,

I'm trying to compile this on Haiku: http://code.google.com/p/jacl/
The "normal" version is using ncursesw so I don't think I can compile it easily, but there is a simpler version (called cjacl), which can compile, but when linking it says:

/boot/common/lib/gcc/i586-pc-haiku/4.3.4/../../../../i586-pc-haiku/bin/ld: cannot find -lm
collect2: ld returned 1 exit status

I'm using gcc4 because the gcc2 can't compile.

Before running make, I did alias gcc='/boot/develop/abi/x86/gcc4/tools/gcc-4.3.3-haiku-100425/bin/gcc'

it seems lm is for libm, which should be in the glibc

Comments

Re: can't find libm

Haiku actually has libm in libroot but should link automatically, ie: you should not need to use -lroot. Remove -lm from the proper file, probably in your Makefile and it should link afterwords.

Use setgcc command to switch between gcc2 & gcc4 compilers.

It is easy to compile and use ncurses library on Haiku. All YAB programs require ncurses to run. ncursesw is with wide character support (UTF-8). Haiku does not include ncurses so you will have to compile your own to use this library.

Re: can't find libm

Haiku math and posix library is libroot

please change all references of "libm" in the code or "-lm" to "" (blank)

because all aplications is linked with libroot by default

Re: can't find libm

thank you both, I managed to compile it thanks to your advices.

I've installed ncursew through haikuports, and even if I couldn't compile using ncursew, I could use the non-wide characters version though.