How do I build a 64 bit Windows application using NI-DAQmx in Visual Studio 2010?
I'm trying to port a 32 bit application to 64 bit. In visual Studio I added the 64 bit configuration to the project. It compiled the source fine but reports link errors:
error LNK2019: unresolved external symbol DAQmxReadAnalogF64 referenced in function NI6008_AnalogInput NI_6281\NI6281.obj
error LNK2019: unresolved external symbol DAQmxCreateAIVoltageChan referenced in function NI6008_AnalogInput NI_6281\NI6281.obj
error LNK2019: unresolved external symbol DAQmxReadDigitalLines referenced in function NI6008_DigitalInput NI_6281\NI6281.obj
error LNK2019: unresolved external symbol DAQmxCreateDIChan referenced in function NI6008_DigitalInput NI_6281\NI6281.obj
error LNK2019: unresolved external symbol DAQmxWriteDigitalLines referenced in function NI6008_DigitalOutput NI_6281\NI6281.obj
error LNK2019: unresolved external symbol DAQmxCreateDOChan referenced in function NI6008_DigitalOutput NI_6281\NI6281.obj
These, of course, are the NI functions I'm using. The NIDAQmx.lib has been added to the Link Input property.
Any help would be appriciated.
- Neil Shore
Solved! Go to Solution.
Did you mean that you added the 64bit in the platform target settings according to this page?: http://zone.ni.com/reference/en-XX/help/372636F-01/mstudiowebhelp/html/64bitcore/
Did you previously have 32 bit application running? Did you change the refernces to 64 bit version?
Do you use Measurement Studio? If so some features aren't supported with 64 bit.
Also when you say you added the NIDAQmx.lib, did you follow this KB:http://digital.ni.com/public.nsf/allkb/38F67B28D995C6958625706E000C580C
Thanks for answering my query.
Your questions prompted me to beter check the path of the NI-DAQmx.lib file. I move the lib file into a local directory so that the build is never dependent on "vender" paths for libraries. That way, my source tree is "pure", i.e., has no dependences on other source trees.
It turned out that I had the x86 lib not the x64 lib. VS 2012 did not reject the 32 bit library for a 64 bit build. It just did not find anything in the library. That is why I was getting all the undefines. When I copied the correct NI-DAQmx.lib, everthing went fine.
I did have to search for the library. I did not find any documentation pointing me to the correct library path.
Its working now. Thanks.
- Neil Shore
Glad to hear that it is working now.
Hi LaserShore,I have the same problem as you.do you have 64bit NI-DAQmx.lib.I am looking forward to your help. Thank you very much. My mailbox is firstname.lastname@example.org
Youu should find the NIDAQmx libraries and headers here:
C:\Program Files (x86)\National Instruments\Shared\ExternalCompilerSupport
I think the subdirectories in there speak for themselves. Might be a good idea to update your NIDAQmx.h file too in your project.