Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Undefined reference to DAQmx functions while compiling C code on Ubuntu

Solved!
Go to solution

Hello.

 

I am trying to compile this exemplary C code at the end of this page using Ubuntu 18.04: https://www.ni.com/de-de/support/documentation/supplemental/21/using-ni-daqmx-in-text-based-programm...

Unfortunately I get the following errors when I try to compile it:

voltagereader.c:(.text+0x58): undefined reference to `DAQmxCreateTask'
voltagereader.c:(.text+0xa9): undefined reference to `DAQmxCreateAIVoltageChan'
voltagereader.c:(.text+0xea): undefined reference to `DAQmxCfgSampClkTiming'
voltagereader.c:(.text+0x108): undefined reference to `DAQmxStartTask'
voltagereader.c:(.text+0x158): undefined reference to `DAQmxReadAnalogF64'
voltagereader.c:(.text+0x192): undefined reference to `DAQmxGetExtendedErrorInfo'
voltagereader.c:(.text+0x1ad): undefined reference to `DAQmxStopTask'
voltagereader.c:(.text+0x1bc): undefined reference to `DAQmxClearTask' 

 

I have tried this solution but I was not able to find the .so file in the same location. I would really appreciate it if somebody could help me run the program.

0 Kudos
Message 1 of 2
(1,440 Views)
Solution
Accepted by topic author demirarikan

Solved! I found it in this location: /usr/lib/x86_64-linux-gnu/libnidaqmx.so. Running the following command successfully compiled the program: gcc voltagereader.c /usr/lib/x86_64-linux-gnu/libnidaqmx.so -o voltagereader.

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