Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

How to program in C++ with DAQmx and g++ on Windows ?

Hi, I successfully managed to convert DAQmx Visual C++ library and link it with mingw32 gcc / g++ on Windows for tests. See thread.

Now that I got the concepts, I want to write a real application :
- multithreaded (pthread-win32)
- in C++

The thing is that I cannot compile my program with the C++ compiler, since NIDAQmx.h is written in C. I tried :

extern "C" {
#include <NIDAQmx.h>
}

but without success.

I don't have any Microsoft programing tool. I only have a subdirectory called "C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev". None about C++.

Please help !!!


Message Edité par dplamp le 03-10-2006 05:17 AM

0 Kudos
Message 1 of 3
(3,651 Views)
Additionnal questions :
- Would using NIDAQmx-base help solving the problem ?
- Would installing a MS development tool prior to install DAQmx install a C++ API ? If yes, could it be converted to be used with g++, as was the C API with gcc ?
0 Kudos
Message 2 of 3
(3,639 Views)
OK, it was a mingw issue. It does not recognize Windows specific type __int64. 2 typedef lines in NIDAQmx.h need to be corrected as follows, replacing "__int64" with "long long".

#ifndef _NI_int64_DEFINED_
#define _NI_int64_DEFINED_
/*    typedef __int64            int64;*/
    typedef long long    int64;
#endif
#ifndef _NI_uInt64_DEFINED_
#define _NI_uInt64_DEFINED_
/*    typedef unsigned __int64   uInt64;*/
    typedef unsigned long long    uInt64;
#endif

0 Kudos
Message 3 of 3
(3,637 Views)