Error LNK2019 When Running Visual Studio C++ Example Programs

Updated Mar 22, 2018

Reported In

Driver

  • NI-DAQmx
  • NI-488.2
  • NI-VISA

Issue Details

I'm trying to run one of these DAQmx, VISA, or 488.2 C++ programs in Visual Studio but I receive Error LNK2019 whenever I build the application. How do I resolve this error?

Solution

The Visual Studio project is likely missing some required dependencies which are not included by default in the examples folder. Try the following steps to resolve this error:
  1. Open your Visual Studio C++ project, and go to Project>>Properties. In the Properties window, go to Configuration Properties>>VC++ Directories. Click the Include Directories field. Then click the arrow that appears and select <Edit...>.
  1. In the dialog box that opens, click the New Line button, add the directory that contains the header file and click OK.
  1. Repeat this process with the Library Directories field and add the directory that includes the relevant library.
  2. Compile your Visual Studio project, and the linking errors should be resolved. If they are not, make sure you are using the directories that contain the correct libraries and include files. For instance, the you can find the necessary libraries and include for VISA in the following folder: 
C:\Program Files\IVI Foundation\VISA\Win64

If compiling a 32-bit application use the corresponding folder in C:\Program Files (x86)

WAS THIS ARTICLE HELPFUL?

Not Helpful