Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Dev-C++ compiling question

I'm using the free Dev-C++ IDE with my USB-6008 DAQ and I can make my C program work fine with the MS Visual Studio but not with Dev-C++.  I figured out that I needed to put the nidaqmx.h file in the "Include" folder for Dev-C++ and that changing the extension of the nidaqmx.lib file to a ".a" file gets past compiler errors saying it couldn't find the functions in the .lib file.  But now it says it "can't find -Inidaqmx" which I'm told is an initialization flag or file or something.  I don't know what a flag is exactly.

Can anyone tell me more about this and possibly suggest a solution?

thanks,

shawn
0 Kudos
Message 1 of 8
(3,554 Views)
I can hardly imagine that renaming your nidaqmx.lib to .a does solve your problem.

You could try putting a copy of nidaqmx.h and nidaqmx.lib in the same folder where your .cpp to compile is. Try this. Perhaps it will be of success.
In order to understand the recursion, you have to understand the recursion at first!
0 Kudos
Message 2 of 8
(3,545 Views)

Thanks, but I already put the NIDaqmx.h and NIDaqmx.lib in the correct location.  I no longer get the "can't find NIDaqmx.h file" and the "can't find functions" errors so I think that is OK.  It is just this -Inidaqmx flag problem.

Any coding gurus out there that can explain this?

thanks,

shawn

0 Kudos
Message 3 of 8
(3,541 Views)
All you should have to do is include those header files, nidaqmx.lib and nidaqmx.h and it should work.

Try compiling and running one of the examples that ships with DAQmx.  What version are you using?  You should find the examples in a folder located at "C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\"

Open one of the examples in this folder and see if it compiles.  If you're still having problems, repair your driver install and make sure you have the newest version (version 8.3).  Let us know if it works for you or not.
Elijah Kerry
NI Director, Software Community
0 Kudos
Message 4 of 8
(3,536 Views)
Hi Elijah,

That doesn't seem to work.  Everything works fine with visual studio but not with Dev-C++.  (A free IDE/compiler available on the internet).

shawn
0 Kudos
Message 5 of 8
(3,517 Views)
I found a thread on our discussion forums that has some hints for how to get Dev-C working.  We don't officially support Dev-C, but it seems people have had some success in the past.

Check it out here: http://forums.ni.com/ni/board/message?board.id=250&message.id=26422
Elijah Kerry
NI Director, Software Community
0 Kudos
Message 6 of 8
(3,500 Views)
Elijah,

You are referencing this thread.  Was there another thread you meant to send me a link to?

thanks,

shawn
0 Kudos
Message 7 of 8
(3,485 Views)
My apologies - I'm not sure how that happened.  The link I meant to send you is: http://forums.ni.com/ni/board/message?board.id=250&message.id=10936 which has information on similar problems experienced with GCC compilers in general.

It seems that you may need to generate a wrapper dll from the NIDAQmx.h file using CVI or some other supported compiler and then compile the resultant file into your application.  Check out the other thread and let me know if it helps.


Elijah Kerry
NI Director, Software Community
0 Kudos
Message 8 of 8
(3,480 Views)