Hi all,
I am a beginner to CUDA and having a difficulty compiling a program. The error message when I typed “make” is following:
[codebox]/tmp/cc86tU8n.o: In function `Store_Image(unsigned char*, char*, int, int)':
utils.c:(.text+0x215): undefined reference to `jpeg_std_error’
utils.c:(.text+0x239): undefined reference to `jpeg_CreateCompress’
utils.c:(.text+0x2ad): undefined reference to `jpeg_stdio_dest’
utils.c:(.text+0x2e1): undefined reference to `jpeg_set_defaults’
…
[/codebox]
I guess that those error messages are related to jpeglib.h included in utils.c. When I compile utils.c without CUDA, I put “/usr/lib/libjpeg.so.62” at the end of the compile command. The thing is that I don’t know how to include extra libraries under CUDA environment.
For example, normally I do…
[codebox] gcc -g -o $@ $(OBJECTS) /usr/lib/libjpeg.so.62 [/codebox]
how can I do this in CUDA?
Below is Makefile that I have from template code.
[codebox]# Add source files here
EXECUTABLE := practice
CUDA source files (compiled with cudacc)
CUFILES := practice.cu
CUDA dependency files
CU_DEPS := \
practice_kernel.cu \
utils.h \
C/C++ source files (compiled with gcc / c++)
CCFILES := \
practice_gold.cpp \
utils.c \
############################################################
####################
Rules and targets
include …/…/common/common.mk
[/codebox]
I am not sure where I should edit. Should I compile each files separately? or is there any file that I should edit to include the extra library?
Thank you for reading, and really hope for a help. Thanks again.