LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Including CVI code to a Visual Studio project

Hi!

 

I want to use GoogleTest and C++ to test my CVI project. I made a project in Visual Studio 2019 for this, and thought to add in my CVI code through "extern "C" {#include "myfile.h"}. I don't know if this was the best way to go about this, but I thought it would be a nice and easy way to test my code without too much hassle. My problem is (predictably) that VS doesn't recognize the "CVICALLBACK" keyword.

 

I think what I need to do is to include "cvirte.h" to the test project, but I'm not sure (have not managed to). In CVI everything is set up automatically so I can just reference the file by #include <cvirte.h>, but not in VS. I tried to add the path to the folder where the file exists (C:\Program Files (x86)\National Instruments\CVI2020\include) to the project path in Visual Studio, but it cannot find the file.

 

I'm not sure whether I'm just Visual Studio-incompetent, or if I'm trying to go about the problem in the wrong way. Any advice would be much appreciated!

0 Kudos
Message 1 of 2
(1,076 Views)

Update: I managed to include the <cvirte.h> by adding the path to the include directories in Project->Project Properties->VC++ Directories->Include Directories and to Project->Project Properties->Debugging->Environment (adding it to PATH).

 

However, that does not solve the issue that Visual Studio does not recognize "CVICALLBACK". What do I need to include for it to understand this keyword?

0 Kudos
Message 2 of 2
(1,044 Views)