cannot find -lcutil

For some strange reason I am getting the above mentioned error when i try to compile my program with the following Makefile:

Add source files here


Cuda source files (compiled with cudacc)


C/C++ source files (compiled with gcc / c++)

include …/…/…/common/

All the other programs included in the SDK compiles smoothly. Any ideas why I get the compile error with my own program?

I’ll partially answer my own question:

It didn’t like that I placed my src code in sub sub dir in projects. Strange…

Hi LightRaven.

I usually use CUDA with Microsoft visual studio 2005.

When I use CUDA on linux opensuse10.2. I got same your problem.

all files I store in the same my own directory.

I copied to my directory and create a Makefile.

when I build this project I got same your problem

“/usr/lib64/gcc/x86_64-suse-linux/4.1.2/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -lcutil”

can you please tell me more detail how to solve this problem.

thank you very much.

Hello. I have the same problem:

/usr/lib/gcc/x86_64-pc-linux-gnu/4.1.2/…/…/…/…/x86_64-pc-linux-gnu/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/template] BÅ‚Ä…d 1

How solve this?
Thanks for help.

you will have to add the directory containing to LD_LIBRARY_PATH

enter directory common and enter make
then you will find in the upper directory lib/ libcutil.a

add this directory into LD_LIRARY_PATH

then it will be OK

I am having the same issue. I am using Linux Red Hat 3.4.6.

I am trying to compile and run some of the programs given with the SDK. I get the following:
bandwidthTest> make
/usr/bin/ld: cannot find -lcutil
collect2: ld returned 1 exit status
make: *** […/…/bin/linux/release/bandwidthTest] Error 1

I have confirmed that /usr/local/cuda-sdk/lib where the libcutil.a is located is in my LD_LIBRARY_PATH. What else do I need to do? I do not have a .so file, do I need that?

Any help anyone can provide would be greatly appreciated.

Thank you!

I did this but it still gives me the same error. “cannot find lcutil”. Please help.

I am pretty sure you have to change DIRs as well!

Make sure, that freeglut3 and freeglut3-devel packages are installed.

On 64bit systems:

Change the LD_LIBRARY_PATH from /usr/local/cuda/lib

to /usr/local/cuda/lib64 …

export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH

…and try again.

-lcutil failure means the that directory containing libcutil.a is not listed in the linking list if the file exists.

By default installation, it is should be C/lib, or relative to the project src in SDK, …/…/lib so you can see -L…/…/lib, the libcutil.a can be found and linked.

Your libcutil.a is not in default directory, that’s fine, but guarantee it will appear in the final link command like -L/usr/local/cuda-sdk/lib

elegant way is to change line LIBDIR in common/, or ROOTDIR, depending on your installation.

LD_LIBRARY does not take any effect during building process, it is effective to search directory for dynamic library loading while the program running.

Quite easily being tangled together.

On linux 64bit, into: $(HOME)/NVIDIA_GPU_Computing_SDK/C/lib/
I renamed: libcutil_x86_64.a -----> libcutil.a

You’re my hero!! This is the solution!! I spent all afternoon trying to compile a sdk sample <img src=‘<#EMO_DIR#>/crying.gif’ class=‘bbc_emoticon’ alt=’:’(’ />

Thank you very much :biggrin:

I second that this solved my issue on ArchLinux with cuda 3.2…

I did this…

cd /usr/share/cuda-sdk/C/lib sudo ln -s libcutil_x86_64.a libcutil.a


nvcc … blah… -L /usr/share/cuda-sdk/C/lib … blah

I thought maybe I could specify a lib so I wouldn’t have to make the symlink, but, I need to know more about static/dynamic libraries and compilers for that to happen. Hope this helps.