Posted 09 May 2013 - 05:04 PM
Posted 10 May 2013 - 10:47 AM
Posted 10 May 2013 - 12:52 PM
Also, both /usr/local/lib/liblabjackusb.dylib and /usr/local/lib/libusb-1.0.dylib are "Mach-O universal binary with 3 architectures".
I have to build my plugin as 32-bit because it gets loaded by a 32-bit application. It's Carbon, by the way. I added the #include for labjackusb.h and the call to LJUSB_GetDevCount(U12_PRODUCT_ID) as in the example project. The call is in an existing function because there's no "main", since the plugin just defines functions callable by the application.
I have installed LabJackHID.
Can you tell me where the executable code for LJUSB_GetDevCount is? Xcode can't seem to find it.
Thanks again- Scott
It looks like your XCode project is trying to build a application with i386 architecture (32-bit Intel processor), but the Exodriver and probably libusb that were built and installed are not i386 architecture. You will want to change your XCode settings so that it builds for the correct architecture. It is probably x86_64 (64-bit Intel), To check the architectures of the Exodriver and libusb library binaries, in a terminal you can use the "file" command on a file. For example:
Alternatively, to support both 32 and 64-bit applications you can use the Mac installer which installs Universal binary versions of Exodriver and libusb or you can build it on your own. Look on the Exodriver page for both the installer and build instructions.
I will also point out that you will need to use the installer at least once for the U12 as it needs LabJackHID kernel extension installed.
Posted 10 May 2013 - 03:11 PM
Posted 13 May 2013 - 08:51 AM
-select Project Navigator icon on the far left
-select the project (just below)
-move to the right and select a target
-select the Build Settings tab near the top (Basic, Combined)
-scroll down to Linking if necessary
-click the disclosure triangle next to Other Linker Flags
-set Debug and Release to -llabjackusb -lusb-1.0
and my project built successfully.
In that case your program isn't finding the liblabjackusb library and its functions (for ex. LJUSB_GetDevCount) probably because you didn't link to it in your project. In your project settings go to the build tab and under Linking->Other Linker Flags add "-llabjackusb" (without quotation marks). You'll probably want to do this for all configurations.
Posted 13 May 2013 - 11:31 AM
Posted 13 May 2013 - 05:25 PM
I'm glad that helped. I would like to point out that "-lusb-1.0" is not needed unless you are going to use libusb functions in your program. liblabjackusb will handle the libusb linking it needs.
OK, thanks. I only included lusb-1.0 because it was in the Exodriver example. I've now removed it and the project still builds and runs fine.
Thanks again for your help.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users