07-24-2015 02:10 PM
Hi,
Very basic question but I couldn't find the solution after searching online for several hours.
I'm running NIDaqMX 14.1 in Windows 7 64-bit (although the NIDAQmx is installed in Program Files (x86)). I'm trying to interface with a PCIe-6353 with Qt Creator 3.4.2 (Based on Qt 5.5.0 (MSVC 2013, 32 bit). I included the nidaqmx.lib in the .pro file but I get LNK2019 messages for unresolved externals for all of the NI commands. The code and project file are below:
Does the NI library only work with mingw and not msvc?
#include <QCoreApplication> #include "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h" int main(int argc, char *argv[]) { TaskHandle taskHandle; int error; // DAQmx analog voltage channel and timing parameters error = DAQmxCreateTask("", &taskHandle); // error = DAQmxCreateAOVoltageChan(taskHandle,"Dev3/ao0","",-10.0,10.0,DAQmx_Val_Volts,NULL); DAQmxStopTask(taskHandle); DAQmxClearTask(taskHandle); QCoreApplication a(argc, argv); return a.exec(); }
The .pro file is as follows
QT += core QT -= gui TARGET = untitled CONFIG += console CONFIG -= app_bundle TEMPLATE = app HEADERS += "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h" LIBS += "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc\NIDAQmx.lib" SOURCES += main.cpp
07-26-2015 11:23 AM
You can certainly compile code that uses the DAQmx DLL with MSVC---I do it all the time.
I think that library you're trying to link to is a 32-bit library. Try using the following include and lib dirs:
C:/Program Files (x86)/National Instruments/Shared/ExternalCompilerSupport/C/include
C:/Program Files (x86)/National Instruments/Shared/ExternalCompilerSupport/C/lib64/msvc
HTH,
Adam
11-06-2015 07:49 AM
I am new to QT but am experiencing the same problem described in this thread.
The lib folder
C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc
contains only a lib file and no DLL.
where will my compiler find nidaqmx.dll
11-09-2015 05:36 PM
Hi cpbandy,
For future reference, I would recommend creating a new forum post so that your questions are not overlooked.
Also, regarding your question, the DAQmx functions are in a static library(.lib) so the dynamic library of the fuctions (.dll) that you're looking for does not exist.
09-07-2021 03:59 AM
Hi,
i just linked int my QT project like this
LIBS += -L$$PWD/'../../../../../Program Files (x86)/National Instruments/Shared/ExternalCompilerSupport/C/lib64/msvc/' -lNIDAQmx
and i don't have any error, but when i try to use a function
DAQmxCreateTask("",&taskHandler);
I have an error "undefined reference to 'DAQmxCreateTask'
Anybody can help me please ?
09-07-2021 04:04 AM
I have the same problem, did you fix yours ?