LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

undefined reference to ni845xFindDevice

Solved!
Go to solution

I'm trying to use ni 845x driver to send i2c data. I'm trying to write a C application and see if the api calls work but I'm getting this following error 

 

undefined reference to `ni845xFindDevice@12'
collect2.exe: error: ld returned 1 exit status.

I also cannot find example code for driver development in  C:\Program Files (x86)\National Instruments\NI-845x\MS Visual C 

 

Below is my code for reference.

 

 

 

 

#include <stdio.h>
#include "C:\Program Files (x86)\National Instruments\NI-845x\MS Visual C\ni845x.h"

int main()
{
  
	char resource_name[256];
	NiHandle device_find_handle;
	uInt32 found_devices_count = 0;
	int32 tmp = 0;
	int ret = -1;
	tmp = ni845xFindDevice(resource_name, &device_find_handle, &found_devices_count);

    return 0;
}

 

 

 

 

 

0 Kudos
Message 1 of 2
(1,393 Views)
Solution
Accepted by topic author peace9795

You also need to add in your project settings the import library for this "driver". There should be a file ni854x.lib or similar in the same location as your header file or close to it. This needs to be added to your project.

 

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 2
(1,348 Views)