LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   undefined reference error in .so while creating executable (https://www.linuxquestions.org/questions/programming-9/undefined-reference-error-in-so-while-creating-executable-873514/)

Krupa Gururaj 04-07-2011 01:19 AM

undefined reference error in .so while creating executable
 
Hi,

I am trying to create an executable from a .c file by linking a shared library ( .so ) which is already created using a makefile.
.c file is compiling but while linking its throwing an error from .so saying undefined reference. See below.

/usr/lib/libequ.so: undefined reference to `iirQ14'
/usr/lib/libequ.so: undefined reference to `ROUNDQ15'
/usr/lib/libequ.so: undefined reference to `iirQ14LongCoef32'
/usr/lib/libequ.so: undefined reference to `iirQ14Long'
make: *** [project] Error 1

I am using ubuntu linux. Following is my command to create an executable -

project : mp4040equ_test.o
arm-none-linux-gnueabi-ld mp4040equ_test.o -o project -L /usr/lib -lstdc++ -lequ

-- where i am linking my own library as well as stdc++ library using -l.

Thanks in advance.

dwhitney67 04-07-2011 07:48 PM

Those undefined reference errors are indicating that the linker cannot resolve these functions: iirQ14, ROUNDQ15, iirQ14LongCoef32, and iirQ14Long.

Your post seems to imply that you think they are defined with the libequ.so library; my question to you is... are you 100% sure? Or is it possible that the libequ.so is in a directory other than /usr/lib?

P.S. I know that those functions are not part of libstdc++.so.

archtoad6 04-08-2011 08:54 AM

Please put code, command line output, config files, etc. inside [CODE] tags, aka "Code:" blocks.

It will make your posts easier to read, & that will get you more, faster, better answers. -- Help us help you.

Thank you.

P.S. - You can edit your post(s) to do this retroactively.


All times are GMT -5. The time now is 02:01 AM.