Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

Problems with C using Linux and Exodriver


  • Please log in to reply
1 reply to this topic

#1 SteveOll

SteveOll
  • Members
  • 14 posts

Posted 02 April 2013 - 02:44 PM

Hi, I've been attempting build a simple C program, but I am running into a problem in that the code will compile but it won't build and returns the following error messages: ----------Build Started-------- /bin/sh -c '"make" -j 4 -f "Test_wsp.mk"' ----------Building project:[ TestU3HV - Debug ]---------- make[1]: Entering directory `/home/steveoll/Documents/Test' gcc -o ./Debug/TestU3HV ./Debug/main.o "-L." ./Debug/main.o: In function `main': /home/steveoll/Documents/Test/main.c:23: undefined reference to `openUSBConnection' /home/steveoll/Documents/Test/main.c:26: undefined reference to `getCalibrationInfo' /home/steveoll/Documents/Test/main.c:30: undefined reference to `eDAC' /home/steveoll/Documents/Test/main.c:37: undefined reference to `eAIN' /home/steveoll/Documents/Test/main.c:44: undefined reference to `closeUSBConnection' collect2: ld returned 1 exit status make[1]: *** [Debug/TestU3HV] Error 1 make[1]: Leaving directory `/home/steveoll/Documents/Test' make: *** [All] Error 2 ----------Build Ended---------- 0 errors, 0 warnings The above is taken from the CodeLite C/C++ IDE (Revision 4189) although I get similar errors with Geany and Eclipse IDEs I am not sure what the problem is as I am sure that all of the header files are correctly referenced/located. If there is anyone out there that is familiar with building C/C++ programs for Labjack with Linux, your help would be appreciated. -Steve

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 02 April 2013 - 04:37 PM

It looks like you need to add the u3.h and u3.c files to your project/build as that is where the openUSBConnection, getCalibrationInfo, etc. functions are provided. They provide helper functions but are not built as libraries. If you are doing your own Makefile, take a look at the one from our examples:

https://github.com/l...les/U3/Makefile


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users