unresolved external symbol mxDestroyArray referenced in function mexFunction
Mostra commenti meno recenti
Hi All I am integrating MATLAB to run cuda prog via MEX interface. It runs fine with following combination 1.MATLAB 64bit 2012 r2 2.Windows 64bit OS But when i tried same thing on MATLAB 2008 32 bit on windows 64 bit version it gives following linking error
vecsum.obj : error LNK2019: unresolved external symbol mxDestroyArray referenced in function mexFunction vecsum.obj : error LNK2019: unresolved external symbol mxCreateDoubleScalar referenced in function mexFunction vecsum.obj : error LNK2019: unresolved external symbol mexPrintf referenced in function mexFunction vecsum.obj : error LNK2019: unresolved external symbol mexErrMsgIdAndTxt referenced in function mexFunction vecsum.mexw32 : fatal error LNK1120: 4 unresolved externals
I have set the nvmexopts64.bat LINK path like this
rem Linker parameters
rem ********************************************************************
set LIBLOC=%MATLAB%\extern\lib\win32\microsoft
set LINKER=link
set LINKFLAGS=/dll /export:%ENTRYPOINT% /MAP /LIBPATH:"%LIBLOC%" libmx.lib libmex.lib libmat.lib /implib:%LIB_NAME%.x /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
set LINKOPTIMFLAGS=
set LINKDEBUGFLAGS=/DEBUG /PDB:"%OUTDIR%%MEX_NAME%%MEX_EXT%.pdb"
set LINK_FILE=
set LINK_LIB=
set NAME_OUTPUT=/out:"%OUTDIR%%MEX_NAME%%MEX_EXT%"
set RSP_FILE_INDICATOR=@
==================
i also put the additional lib path and lib like libmex.lib libmx.lib libmat.lib to the command line like this " nvmex -f nvmexopts64.bat vecsum.cu -IC:\CUDA\include -LC:\CUDA\lib\x64 -lcufft -lcudart –lcuda -LPathto the lib dir of matlab -I path to the include dir of matlab -llibmex -llibmx -llibmat"
But it did not work
Risposte (1)
Kaustubha Govind
il 13 Lug 2012
0 voti
I'm assuming you have two versions of MATLAB on your 64-bit machine - one 32-bit, the other 64-bit. From what I understand, you are able to compile your MEX-files on the 64-bit MATLAB, but not on 32-bit MATLAB? Did you run 'mex -setup" on the 32-bit MATLAB before compiling? You will need to run "mex -setup" every time you switch between the two installations.
4 Commenti
sharad saurbh
il 18 Lug 2012
Kaustubha Govind
il 18 Lug 2012
Modificato: Kaustubha Govind
il 18 Lug 2012
If you have 64-bit MATLAB installed, you do need to link against all 64-bit libraries and use a 64-bit compiler. Note that Visual Studio itself is always a 32-bit application (and is installed in "Program Files (x86)"), but you need to make sure that the x64 Compilers package is selected at installation.
sharad saurbh
il 20 Lug 2012
Kaustubha Govind
il 20 Lug 2012
Yes, that is correct.
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!