@:~/Documents/InterviewSolution/InterviewSolution$ which cc /usr/bin/cc @:~/Documents/InterviewSolution/InterviewSolution$ ls -al /usr/bin/cc lrwxrwxrwx 1 root root 20 11月 8 19:59 /usr/bin/cc -> /etc/alternatives/cc @:~/Documents/InterviewSolution/InterviewSolution$ ls -al /etc/alternatives/cc lrwxrwxrwx 1 root root 12 11月 8 19:59 /etc/alternatives/cc -> /usr/bin/gcc
参考
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,
mpicc -o sample sample.c -lm
If you are working with C++ you should not compile using the C compiler, use g++ instead.
Ubuntu Uundefined reference to symbol 'pow@@GLIBC_2.2.5'
今天建了一个工程,make后,报错 /usr/bin/ld: Caculator/Calculator.o: undefined reference to symbol 'pow@@GLIBC_2.2.5'因为使用了mathematical functions,一开始我是在makefile里添加了-lm,但是仍报错,后来检查发现我用的是gcc,于是我把$(CC)改成g++后不报错了。我的工程本...