How Can I Program in C with DAQmx Base Using Visual Studio 2005?
Primary Software: Driver Software>>NI-DAQmx Base
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
Problem: I am trying to write a program in C using the DAQmx Base API, but my project will not build in Visual Studio 2005. I also might be receiving one of the following errors:
- fatal error C1083: cannot open include file 'NIDAQmxBase.h': no such file or directory
- fatal error LNK1104: cannot open file 'nidaqmxbase.lib'
- error LNK2019: unresolved external symbol <...>
Solution: In order for you project to build, Visual Studio must know the path to both NIDAQmxBase.h and the nidaqmxbase.lib files. You must also specify for the linker to search in the nidaqmxbase.lib file for any DAQmx Base function calls you make.
To add the header file (and clear
fatal error C1083):
- In the Solution Explorer in Visual Studio, right click on your project and select Properties.
- In the Property Pages window, navigate to Configuration Properties » C/C++ » General and add the path to NIDAQmxBase.h (typically C:\Program Files\National Instruments\NI-DAQmx Base\Include) to the Additional Include Directories field.
- Add #include "NIDAQmxBase.h" to the top of your source file.
To add the .lib file (and clear
fatal error LNK1104):
- In the Solution Explorer in Visual Studio, right click on your project and select Properties
- In the Property Pages window, navigate to Configuration Properties » Linker » General and add the path to nidaqmxbase.lib (typically C:\Program Files\National Instruments\NI-DAQmx Base\Lib) to the Additional Library Directories field.
To configure your linker to search nidaqmxbase.lib
(and clear
error LNK2019):
- Make sure you've added the .lib file as described above.
- Add #pragma comment(lib, "nidaqmxbase.lib") to the top of your source file.
Related Links:
KnowledgeBase 3NDDQLDD: Programming with DAQmx Base in VB 6.0, VB.NET and C#
Attachments:
Report Date: 01/11/2008
Last Updated: 01/11/2008
Document ID: 4HAEE7QQ