Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-DAQmx Base examples do not compile on Mac OS X 10.9

Solved!
Go to solution

I have a USB-6009 device and I am running Mac OS X 10.9.1. I downloaded and installed NI-DAQmx Base 3.7.0 for Mac. I can run Isdaq.app and I see the USB device. When I try to compile the example programs according to the ReadMe.rtf that is in the documentation folder I get an error that the header file cannot be found. I do see the nidaqmxbase and nidaqmxbaselv in /Library/Framworks so I think the .dmg installed properly. Is this a problem with Mavericks? It seems simple enough.

 

$ cd /Applications/National Instruments/NI-DAQmx Base/examples/ai

$ make

gcc -O2 -arch i386 acquireNScans.c -framework nidaqmxbase -framework nidaqmxbaselv -o acquireNScans

acquireNScans.c:46:10: fatal error: 'nidaqmxbase/NIDAQmxBase.h' file not found

#include <nidaqmxbase/NIDAQmxBase.h>

         ^

1 error generated.

 

Thanks!

 

 

0 Kudos
Message 1 of 5
(9,577 Views)

Hello Romp,

 

What program are you using to compile the example programs?

 

 

0 Kudos
Message 2 of 5
(9,548 Views)

I am using the Makefile that comes in the example programs. Essentially gcc from the command line. My gcc is the version that comes with Xcode developer tools.

 

I am running the following line in the terminal.

$ gcc -O2 -arch i386 acquireNScans.c -framework nidaqmxbase -framework nidaqmxbaselv -o acquireNScans

 

Here's my gcc version information, which looks interesting. Maybe I should use a gcc compiler that's not from Xcode.

 

$ gcc -v

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

Target: x86_64-apple-darwin13.0.0

Thread model: posix

 

Thanks!

 

0 Kudos
Message 3 of 5
(9,543 Views)
Solution
Accepted by topic author Romp94

Romp94 wrote:

When I try to compile the example programs according to the ReadMe.rtf that is in the documentation folder I get an error that the header file cannot be found. I do see the nidaqmxbase and nidaqmxbaselv in /Library/Framworks so I think the .dmg installed properly. Is this a problem with Mavericks? It seems simple enough.

 

It's a change in the default Framework search path for Xcode 5.

 

Xcode 5 does not search /Library/Frameworks any longer, so you will need to add -F/Library/Frameworks to the compiler options in the Makefile to instruct the compiler to search that folder again.

 

My team is aware of the change and is working to accommodate the new behavior in Mavericks. For now, you'll need to update the Makefile.

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
Message 4 of 5
(9,529 Views)

That fixed it! Compiles and runs now. 

 

Thank you!

0 Kudos
Message 5 of 5
(9,515 Views)