From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Missing dependencies in Visual C++ for VISA

Solved!
Go to solution

Hello,

I have a little problem with VISA in Visual C++. During compilation of my project I get the following errors:

 

1>------ Erstellen gestartet: Projekt: VISA, Konfiguration: Release Win32 ------
1>FindRsrc.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_viFindRsrc@20".
1>FindRsrc.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_viOpenDefaultRM@4".
1>FindRsrc.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_viOpen@20".
1>FindRsrc.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_viFindNext@8".
1>FindRsrc.obj : error LNK2001: Nicht aufgelöstes externes Symbol "_viClose@4".
1>C:\Users\D.Eiteneuer\Desktop\Test\VISA\Release\VISA.exe : fatal error LNK1120: 5 nicht aufgelöste externe Verweise.
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========

 

which means something like (translated only second line):

1>FindRsrc.obj : error LNK2001: Unresolved external symbol "_viFindRsrc@20".

 

I have included the VISA header via

#include "visa.h"

and added

"C:\Program Files\IVI Foundation\VISA\WinNT\include"

to the include directory list in the project properties.

Apparently I am still missing a dependency. But what dependencies I need to embed?

 

I attached my Visual C++ 2010 project.

 

Best regards

Nuesel

0 Kudos
Message 1 of 2
(4,073 Views)
Solution
Accepted by topic author Nuesel

You should link the import library file for the VISA-C DLL.

Add visa32.lib (or visa64.lib for x64 project) to your project, or add the following pragma.

 

#ifdef WIN64
 #pragma comment( lib, "lib/visa64")
#else
 #pragma comment( lib, "lib/visa32")
#endif

The LIB files are found at Program Files/IVI Foundation/VISA/WinNT/lib/msc directory.

0 Kudos
Message 2 of 2
(4,070 Views)