Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to build a simple program

I purchase the CVI Linux module a few months ago and finally installed it.  I have a simple program that converts a file of binary data to text data.  I can easily compile the single .c file.  When I attempt to build the .prj file, however, I get the following error message: ".....toolslib/toolbox/toolbox.o: undefined reference to symbol 'dlopen@@GLIBC_2.1'.  'dlopen...' is defined in DSO /lib/libdl.so.2 so try adding it to the linker command line.'  I thought I did that with the command cvicc -l/lib/libdl.so.2 Bin_to_Txt.prj, but the output of this command includes the message "...cannot find -l/lib/libdl.so.2".  libdl.so.2 is located in /lib.  Does anyone have any ideas on how to get the linker to find the file?  Thanks.

0 Kudos
Message 1 of 4
(4,329 Views)

I will preface this by saying that I'm not a CVI expert, but this is my suggestion based on Linux knowledge. Usually the -l linker option takes the name of a shared library, not a path. Try "-ldl" instead of "-l/lib/libdl.so.2".

0 Kudos
Message 2 of 4
(3,449 Views)

Adam, Thanks for the info.  Adding -ldl to the cvicc command led to a successful build (after I commented out a call to DebugPrintf).  I put in the full path initially because I didn't find any environment variables set for library (or header file) search paths.  I assume that cvicc has default search paths for both, but I didn't see any reference to paths in the (rather scant) documentation. 

Unfortunately, the program (which runs fine under XP) didn't run correctly under Linux.  I might post another question related to these problems in the future.   

0 Kudos
Message 3 of 4
(3,449 Views)

I'm glad to hear that this worked. There is a default search path. Typically at least /lib and /usr/lib are included, but I don't know what the cvi linker uses. You can add paths for the linker to search using -L/path/to/search.

0 Kudos
Message 4 of 4
(3,449 Views)