ld: undefined reference to symbol 'log2@@GLIBC_2.2.5'
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Whats wrong with for (level = 1; level <= log2((double)size); level++) ^ Seems like its from using log2() but whats wrong? I am using it with OpenMPI code actually, but commenting this line fixes things. Full Source ( http://pastie.org/7559178 ) see line 40 [jiewmeng@JM Assign3]$ mpicc -o cpi cpi.c && mpirun -np 16 cpi /usr/bin/ld: /tmp/cca9x4he.o: undefined reference to symbol 'log2@@GLIBC_2.2.5' /usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /usr/lib/libm.so.6 so try adding it to the linker command line /usr/lib/libm.so.6: could