Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Can ANSI C DAQmx.lib be compliled in 64bit mode?

I was tried to use VC2008 to compile a 64bit program based on DAQmx on a 64bit Windows Vista. I used DAQmx.lib provided in the DAQmx 9.0 package located in C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc. But I got a bunch of link errors:

 

error LNK2001: unresolved external symbol DAQmxResetDevice

error LNK2001: unresolved external symbol DAQmxClearTask

 

I tried to change the compilation target to 32bit and everything works. Is there any solution to help me make the program complied in 64bit?

0 Kudos
Message 1 of 9
(9,378 Views)

Hi Fieng,

 

I think that DAQmx 9.0 does not support compiling for 64bit mode, and I am currently checking with R&D regarding this. I will let you know what I find. 

Rasheel
0 Kudos
Message 2 of 9
(9,351 Views)

Hi Fieng,

 

It seems that compiling for 64bit mode is supported by your version of DAQmx. Would it be possible to try compiling an NI provided example program in 64bit mode? 

 

I did find a KnowledgeBase article here that references the error you were seeing. I'm not sure if this is relevant though, because you were able to get your code compiled in 32bit mode.

 

Could you please try compiling the example programs? Let me know how that goes! 

Rasheel
0 Kudos
Message 3 of 9
(9,343 Views)
We are experiencing the same errors on 64-bit Vista (using Visual Studio 2008 Pro).  Works fine on 32-bit XP (Visual Studio 2008 Express).  What NI examples are you referring to?  Given that hundreds of people viewed this thread since August 2009, I would say the NI guys have something to fix here.
0 Kudos
Message 4 of 9
(8,979 Views)

Hello michael505,

 

Which version of NI-DAQmx are you using?  DAQmx supports ANSI C native 64-bit operation since version 8.9, with .NET, C#, and LabVIEW support added in LabVIEW 8.9.5.

 

Please try compiling one of the examples located at C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\ to see if you receive the same error.

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 5 of 9
(8,948 Views)
Ok, it looks like the example code compiles in VS 2008 Pro 64-bit, but will not compile from matlab (error LNK2019: unresolved external symbol DAQmxCreateTask, and then the same error for several other functions).  I checked to make sure that the include and linker paths are correct.  Is this a matlab (mex) problem?  I'm sort of reluctant to jump to that conclusion without more evidence.  If it turns out to be on the matlab side, do you have any suggestions for getting around it?  We use matlab for almost everything in our lab, so we need this to work somehow.  Thanks!
0 Kudos
Message 6 of 9
(8,941 Views)

I don't honestly know much about the Matlab toolkit that interfaces with NI-DAQmx or if it's been updated for 64-bit support.  I know that we have done extensive in-house testing of DAQmx and the 64-bit functions within for both Visual Studio, CVI, and LabVIEW and haven't had any problems with 64-bit functions compiling.  If the examples compile correctly in Visual Studio but won't compile in Matlab, then the issue most likely points to Matlab.  What version of Matlab are you using and what version of the Matlab toolkit are you using to implement DAQmx support in Matlab?

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 7 of 9
(8,935 Views)
Hi, we are using matlab 2008 and trying to make a matlab function from the nidaqmx library.  We can use mex in matlab to compile using external 64-bit libraries from the windows sdk, and only the nidaq libraries (so far) seem to fail.  So basically, I have matlab working with their simple examples and I have the nidaqmx simple example code working, so I'm trying to see if there's some kind of complication from the matlab mex setup not looking in the right place (the mexopts.bat file tells mex where to get the compiler, libraries, etc, and is loaded with messy options and switches).  Is there anything special about the daqmx.lib setup?
0 Kudos
Message 8 of 9
(8,933 Views)

Ok, we solved the problem -- it was that we were using the wrong nidaqmx library file.

 

The correct location for 64-bit systems (on the set LIB= line in mexopts.bat for matlab users), should be C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport\C\lib64\msvc

 

We were using C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc

 

We didn't notice this until we tried to compile the simple nidaqmx example from the command line using cl.exe and so we looked for the include directory in the simple VS 2008 example (right-click on the project -> properties -> configuration properties -> c/c++ -> general -> "additioonal include directories"

 

We noticed it was different from our include path and so we checked the "additional library directories" under configuration properties -> linker -> general -> "additioonal library directories" and noticed that too was different.

 

I must say that it would have been nicer if this info was in the manual or that the directory structure was a little easier for a human to navigate.

 

Thanks for your help!  The most important part of troubleshooting is finding out what is NOT the problem, and we appreciate your posts.

0 Kudos
Message 9 of 9
(8,931 Views)