solve the problem of "cannot find -lglut"

My os is RHEL5.0 (64 bits)

After I install the driver ,toolkit, SDK ,I go to the <SDK_INSTALL_PATH>/projects and make every projetcs.

But when I make the “nbody” ,it appears “/usr/bin/ld :cannot find -lglut”

Then I see the doc “CUDA_SDK_release_note_linux.txt”, and follow his steps,

After that I make the project “nbody” again,

But it appears “/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lglut
/usr/bin/ld:cannot find -lglut”

Then I input #ls /usr/lib64 |grep glut

it displays “”

I input#ln -s /usr/lib64/ /usr/lib64/

Then it will be OK!! :rolleyes:

THanks a lot for the post, it fixed my problem on RHEL 5.4.


Thanks a lot , it helps me directly … i appreciate your sharing of this info.

Thanks a lot, now i can compile sdk examples very well! :wave:

Thanks a lot, now i can compile sdk examples very well! :wave:

Hello there guys! I have just read this thread and then went further to read the release notes… im sure this can solve my problem. Unfortunately I do NOT have
root-user privileges on this computer , hence i CANNOT create the simlink directly in /usr/local …

$ ln -s /usr/lib64/ /usr/lib64/

I read on the release notes that in that case i should proceed modifying the Makefile adding another directory (where i have privileges to create the simlink) to the
library search path (-L). Now, I’ve not worked with makefiles very much… i thought i could figure it out by myself but so far i’ve tried several ways to do it and it
just doesn’t work… how to do it?? please help me on this one. Here is the quote from the release notes…

’ If you have but you do not have write access to /usr/lib, you
can also fix the problem by creating the soft link in a directory to which
you have write permissions and then add that directory to the libarary
search path (-L) in the Makefile. ’