/usr/bin/ld: /tmp/ccywVCvu.o: undefined reference to symbol 'sqrt@@GLIBC_2.2.5'

If your code includes mathematical functions (like exp, cos, etc.), you need to link to the mathematics library libm.so. This is done, just like for serial compiling, by adding -lm to the end of your compile command, that is,

gcc -o test test.cpp -lstdc++ -lm

阅读更多
个人分类: C/C++
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭