11-08-2012 03:34 PM
It seems you are referencing multiple locations with the NiDAQmx.h file. Your compiler output shows you retrieving it from C:\Dev-Cpp\include instead of from one of the NI directories. The line numbers mentioned do not match the line numbers in my version of NI's header file, so I suspect something is wrong with the version you have in Dev-Cpp.
I suggest the following:
1) Remove any copies of NI files from Dev-Cpp.
2) Reference only 1 of "...\\NI-DAQ\DAQmx ANSI C Dev\..." and "...\Shared\ExternalCompilerSupport\...". They both provide the same resources, so including both areas is duplication. On my Windows system the header and library files were the same.
After that I think the example should compile OK.
11-08-2012 03:57 PM
No, it did not work either. Below are the errors I got
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Users\samik\Documents\c_practice\test.cpp" -o "C:\Users\samik\Documents\c_practice\test.exe" -ansi -traditional-cpp -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
In file included from C:\Users\samik\Documents\c_practice\test.cpp:1:
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:77: error: `__int64' does not name a type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:85: error: `__int64' does not name a type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2288: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2288: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2290: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2290: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2292: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2292: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2294: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2294: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2295: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2295: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2297: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2297: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2299: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:2299: error: ISO C++ forbids declaration of `sampsPerChan' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5104: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5104: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5130: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5130: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5131: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5131: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5138: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5138: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5139: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5139: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5142: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5142: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5367: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5367: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5368: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:5368: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:6157: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:6157: error: ISO C++ forbids declaration of `data' with no type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:6175: error: `uInt64' has not been declared
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:6175: error: ISO C++ forbids declaration of `data' with no type
Execution terminated
11-08-2012 04:44 PM
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:77: error: `__int64' does not name a type
C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h:85: error: `__int64' does not name a type
NIDAQmx.h assumes that __int64 is a built-in type unless __linux__ is defined. MinGW defines __int64 as a typedef in one of the standard headers, not as a built-in type. Try including <stddef.h> (or <stdio.h>) before <NIDAQmx.h>.
Brad
12-17-2012 09:40 AM
Not to hijack someone else's thread, but I ran into the same issue today and Brad's solution worked for me. I was extending a project by adding another source file, and all of a sudden I was getting this issue with "error: unknown type name uInt64" . After reading Brad's solution, I realized that I did #include <stdio.h> in my other source files in the previous version that worked, so as soon as I added #include <stdio.h> to my new source file, it built without any issues.
I'm using MinGW on Windows 7.
Thanks.