Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Nidaq(PCI card) problem

Hi, I'm trying to use mex function to interface matlab with visual c++(6.0).The

final goal is to use NIDAQ PCI card through the cable. So I

use this kind of command in matlab. " mex -f mex_nidaq.bat mex_nidaq.write".
But it keeps saying "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version

12.00.8168 for 80x86 Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
LINK : fatal error LNK1104: cannot open file "getValidInputLinkLibraries.obj"
 C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'nidaq_write.exe' failed"

So I compiled this code(mex_nidaq.write) with visual c++(6.0) solely. Then it

said,
" Linking...
nidaq_read.obj : error LNK2001: unresolved external symbol _NIDAQErrorHandler@12
nidaq_read.obj : error LNK2001: unresolved external symbol _DIG_In_Port@12
nidaq_read.obj : error LNK2001: unresolved external symbol _mxGetPr
nidaq_read.obj : error LNK2001: unresolved external symbol

_mxCreateDoubleMatrix_730
nidaq_read.obj : error LNK2001: unresolved external symbol _mxGetScalar
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/nidaq_read.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe."

So I don't know what the problem is.

 

Any help would be appreciated.

 

0 Kudos
Message 1 of 4
(2,777 Views)

It feels like your .lib files and .h files are out of sync.  Are you sure you've got the right ones? I'm not sure, but some libraries don't work with compilers as old as VC6 -- it's 13 years old at this point. 

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 4
(2,771 Views)

Thanks, I'll install new version of VC++.

 

0 Kudos
Message 3 of 4
(2,755 Views)

 I got this messages in Matlab. Do you what the problem is?

 

 

>> mex -f mex_nidaq.bat nidaq_read.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
 
LINK : fatal error LNK1104: cannot open file "getValidInputLinkLibraries.obj"
 
  C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'nidaq_read.dll' failed.
 
??? Error using ==> mex at 208
Unable to complete successfully.

0 Kudos
Message 4 of 4
(2,747 Views)