ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/usr/bin/ld: /tmp/ccr3zqbS.o: undefined reference to symbol 'sin@@GLIBC_2.0'
/usr/bin/ld: not: 'sin@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
/lib/libm.so.6: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
I'm assuming this means I have to add "libm.so.6 to the compile command line, but I'm not sure how to do that. Any help or advice would be greatly appreciated!
Thanks for that suggestion it worked for me. I had the same problem when I was trying to make a package for cwstation - a morse code sound generator (http://cwstation.sourceforge.net/).
src2pkg aborted without giving any useful error messages. So I made a slackbuild script and when I ran it, I got the same error message as in the OP. The problem was to include the "-lm" without patching the Makefile or config file.
The solution was to modify cwstation.SlackBuild as follows:
More generally, if ld is spitting out "undefined reference to symbol 'foo'" "'foo' is defined in DSO 'libbar.so'", you want to add -lbar to your linking options, assuming the library actually exists.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.