Using CImg: LNK1181: cannot open file “m.lib” on windows 7 x64

孤街浪徒 提交于 2019-12-08 05:46:04

问题


In the CImg Makefile I notice a flag "-lm" I think this points to the m.lib file. But for some reason it cannot find it during the Linking phase. I am compiling the code using the following command:

nvcc -o FilledTriangles FilledTriangles.cu -I.. -O2 -lm -lgdi32

"nvcc" is just the nvidia CUDA compiler. It should function similar to g++


回答1:


-lm refers to "libm.so"

In general, -lXYZ is a way of telling the linker that it should resolve the symbols in your compiled code against libXYZ.so (after locating it, usually in /usr/lib).



来源:https://stackoverflow.com/questions/15218426/using-cimg-lnk1181-cannot-open-file-m-lib-on-windows-7-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!