Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion about NI-DAQmx c API and C++ programming.

I know that NI-DAQmx support ANSI C. But I use g++ under linux for years, and I want to stick to it. Isn't it possible?
My understanding is that DAQmx is just a library, like GSL (GNU scientific Library) which is also in C. So I should be able to use my favorite C++ syntaxes (and classes) and compile it with g++.

Make it simple, can the following code be compiled under linux using g++

#include
#include "NIDAQmx.h"

int main(){
TaskHandle analogTask=0;
DAQmxCreateTask("analogInTask", &anaogTask);
cout << "Hello world" ; //cout is not in c but in C++
}
0 Kudos
Message 1 of 2
(3,280 Views)
Yes, you can use the ANSI C DAQmx API in C++ code with no problems. It will compile, link and run just fine.

Hope this helps.
LDP
0 Kudos
Message 2 of 2
(3,269 Views)