1

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++

Shayan Zafar
  • 113
  • 1
  • 13

1 Answers1

0

-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).

Rahul Banerjee
  • 2,343
  • 15
  • 16
  • Might also be worth looking for `libm.a`. – user541686 Mar 05 '13 at 08:01
  • This does not solve the problem. "nvcc" seems to be looking for another file. How do you make nvcc to look for the right file? The problem of the OP is in the title. If you add this to your answer I will upvote you – kon psych Apr 24 '14 at 02:08