Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: error LNK2019
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Ahmed Hakim

Posts: 22
Registered: 1/22/09
error LNK2019
Posted: May 4, 2011 7:45 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello

I'm a beginner in using MEX function, I just have code I purchased from internet and I want to use it inside matlab but when I use MEX function I get such errors

files I use are
SAT_Filter.cpp
SAT_DE.cpp
SAT_Filter.cpp
SAT_Kepler.cpp
SAT_RefSys.cpp
SAT_Time.cpp
SAT_VecMat.cpp
RTOD.cpp

and header files :
SAT_Force.h
SAT_DE.h
SAT_Filter.h
SAT_Kepler.h
SAT_RefSys.h
SAT_Time.h
SAT_VecMat.h
Sat_const.h


>> mex -v SAT_Filter.cpp SAT_DE.cpp SAT_Filter.cpp SAT_Kepler.cpp SAT_RefSys.cpp SAT_Time.cpp SAT_VecMat.cpp RTOD.cpp
This is mex, Copyright 1984-2007 The MathWorks, Inc.

-> Default options filename found in C:\Users\Ahmed Hakim\AppData\Roaming\MathWorks\MATLAB\R2009b
----------------------------------------------------------------
-> Options file = C:\Users\Ahmed Hakim\AppData\Roaming\MathWorks\MATLAB\R2009b\mexopts.bat
MATLAB = C:\PROGRA~1\MATLAB\R2009B
-> COMPILER = cl
-> Compiler flags:
COMPFLAGS = /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD
OPTIMFLAGS = /O2 /Oy- /DNDEBUG
DEBUGFLAGS = /Z7
arguments =
Name switch = /Fo
-> Pre-linking commands =
-> LINKER = link
-> Link directives:
LINKFLAGS = /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2009B\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /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 /nologo /incremental:NO /implib:"C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\templib.x" /MAP:"SAT_Filter.mexw64.map"
LINKDEBUGFLAGS = /DEBUG /PDB:"SAT_Filter.mexw64.pdb"
LINKFLAGSPOST =
Name directive = /out:"SAT_Filter.mexw64"
File link directive =
Lib. link directive =
Rsp file indicator = @
-> Resource Compiler = rc /fo "mexversion.res"
-> Resource Linker =
----------------------------------------------------------------


--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Filter.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_Filter.cpp

SAT_Filter.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_DE.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_DE.cpp

SAT_DE.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Filter.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_Filter.cpp

SAT_Filter.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Kepler.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_Kepler.cpp

SAT_Kepler.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_RefSys.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_RefSys.cpp

SAT_RefSys.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Time.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_Time.cpp

SAT_Time.cpp

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_VecMat.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 SAT_VecMat.cpp

SAT_VecMat.cpp
SAT_VecMat.cpp(464) : warning C4244: 'initializing' : conversion from 'std::streamsize' to 'int', possible loss of data
SAT_VecMat.cpp(884) : warning C4244: 'initializing' : conversion from 'std::streamsize' to 'int', possible loss of data

--> cl /c /Zp8 /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\RTOD.obj -IC:\PROGRA~1\MATLAB\R2009B\extern\include -IC:\PROGRA~1\MATLAB\R2009B\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 RTOD.cpp

RTOD.cpp
Contents of C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\mex_tmp.rsp:
C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Filter.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_DE.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Filter.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Kepler.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_RefSys.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Time.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_VecMat.obj C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\RTOD.obj


--> link /out:"SAT_Filter.mexw64" /dll /export:mexFunction /LIBPATH:"C:\PROGRA~1\MATLAB\R2009B\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /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 /nologo /incremental:NO /implib:"C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\templib.x" /MAP:"SAT_Filter.mexw64.map" @C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\MEX_TMP.RSP

C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\SAT_Filter.obj : warning LNK4042: object specified more than once; extras ignored
Creating library C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\templib.x and object C:\USERS\AHMEDH~1\APPDATA\LOCAL\TEMP\MEX_F9~1\templib.exp
RTOD.obj : error LNK2019: unresolved external symbol "class Vector __cdecl AccelHarmonic(class Vector const &,class Matrix const &,double,double,class Matrix const &,int,int)" (?AccelHarmonic@@YA?AVVector@@AEBV1@AEBVMatrix@@NN1HH@Z) referenced in function "class Vector __cdecl Accel(double,class Vector const &,int)" (?Accel@@YA?AVVector@@NAEBV1@H@Z)
SAT_Filter.mexw64 : fatal error LNK1120: 1 unresolved externals

C:\PROGRA~1\MATLAB\R2009B\BIN\MEX.PL: Error: Link of 'SAT_Filter.mexw64' failed.

can anyone help me?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.