06-12-2023 04:03 PM
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;
}
Solved! Go to Solution.
06-13-2023 03:54 PM
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.