What is arm-linux-gnueabihf-gcc flag -lm for?

Using static library

$arm-linux-gnueabihf-gcc ?O2 -o sample sample.c -I$NE10_INC_PATH -l:$NE1

0_LIB_PATH/libNE10.a

Using dynamic library

$arm-linux-gnueabihf-gcc ?O2 -o sample sample.c -I$NE10_INC_PATH -l:$NE10 _LIB_PATH/libNE10.so -lm

The puzzled thing is that when I use static library, it generates undefined reference error. If I build the application with:

$arm-linux-gnueabihf-gcc ?O2 -o sample sample.c -I$NE10_INC_PATH -l:$NE1

0_LIB_PATH/libNE10.a -lm

The application works on the ARM target, even without PATH variables includ ing libNE10.a library.

I wonder the author made a mistake of -lm with the dynamic library. I am ne w to Linux. I would like to know the meaning of -lm. Could you help me?

Thanks,

Reply to
rxjwg98
Loading thread data ...

math library. sin, cos etc.

-lm = libm.so

-lGL = libGL.so etc.

Reply to
Artem

Hi Artem

I have a question. During building a QT program, Qt Creator 3.0.0 compiler issues the following error: /usr/bin/ld: cannot find -lGL collect2: error: ld returned 1 exit status I had solved this problem by installing a library using apt-get or Ubuntu software center, but I can't recall. Which library should I install to wipe out this error?

TIA, -- Saeed Amrollahi Boyouki

Reply to
amrollahi.saeed

libgl1-mesa*

$ dpkg -S libGL.so libgl1-mesa-dev: /usr/lib/x86_64-linux-gnu/mesa/libGL.so libgl1-mesa-glx:i386: /usr/lib/i386-linux-gnu/mesa/libGL.so.1 libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 libgl1-mesa-glx:i386: /usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0 libgl1-mesa-glx:amd64: /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 libgl1-mesa-dev: /usr/lib/x86_64-linux-gnu/libGL.so

Reply to
Artem

Problem solved! I wrote it down. Thank you -- Saeed

Reply to
amrollahi.saeed

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.