Problem with linking library

Hi All,
I have problem with linking a library.

When I’m linking the library with gcc for a test file its compiling and working properly. The command is here

gcc test.c -L…/sparse_matrix_converter/ -lsparse_matrix_converter -L …/bebop_util/ -lbebop_util -I…/sparse_matrix_converter/include/ -I…/bebop_util/include/

When I’m linking the library with nvcc its giving me the following errors

http://pastebin.com/f61Ej8QQ

The functions in the error are from the library I’m trying to link.

I think the problem is with linking the library.

The nvcc command is

nvcc main.cu -L…/sparse_computations/sparse_matrix_converter/ -lsparse_matrix_converter -L…/sparse_computations/bebop_util/ -lbebop_util -I /home/kiran/NVIDIA_GPU_Computing_SDK/C/cudaworkspace/sparse_computations/ bebop_util/include/ -I /home/kiran/NVIDIA_GPU_Computing_SDK/C/cudaworkspace/sparse_computations/ sparse_matrix_converter/include/ -I /home/kiran/NVIDIA_GPU_Computing_SDK/shared/inc/ -I /home/kiran/NVIDIA_GPU_Computing_SDK/C/common/inc/ -arch sm_13 -L/$HOME/NVIDIA_GPU_Computing_SDK/C/lib -lcutil_x86_64

Can someone please tell me how to link it properly with nvcc.

Thanks and regards,
M. Kiran Kumar.

Hi All,
I solved the problem now. I declared the function in the header file of the library as

extern “C” function decleration

But when I’m using make files to compile, its giving the same error (i.e undefined reference to function). My make file looks like this

EXECUTABLE := splitsort_modified

Cuda source files (compiled with cudacc)

CUFILES_sm_13 := main.cu
COMMONFLAGS := -L…/sparse_computations/sparse_matrix_converter/ -lsparse_matrix_converter -L…/sparse_computations/bebop_util/ -lbebop_util

INCLUDES := -I …/sparse_computations/bebop_util/include/ -I …/sparse_computations/sparse_matrix_converter/include/

CU_DEPS_sm_13 := sc_kernel.cu scan.cu.h splitFuncs.h splitKernel.cu

################################################################################

Rules and targets

include …/…/common/common.mk

Thanks and regards,
M. Kiran Kumar.