WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

PSOPT C/C++ Projekt - mit mex -> Unable to complete succe

 

mpla
Forum-Newbie

Forum-Newbie


Beiträge: 4
Anmeldedatum: 08.01.14
Wohnort: Oberösterreich
Version: ---
     Beitrag Verfasst am: 08.01.2014, 14:52     Titel: PSOPT C/C++ Projekt - mit mex -> Unable to complete succe
  Antworten mit Zitat      
Hallo

Ich hab ein C/C++ Projekt welches ich mit
"nmake -f Makefile.vc all" kompilieren kann. diese EXE Datei funktioniert auch

ich habe in der simple_ode.cpp-Datei "void main..." mit dem richtigen "void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[])
{ .... " ausgetauscht und in dem MATLAB-File
"matlabSCRIPT.m" die LINKER-Anweisungen von C auf Matlab übersetzt
"matlabSCRIPT.m" sollte somit gleichbedeutend zu "Makefile.vc (welches Makefile.vc und MicrosoftVisualStudio.inc" beinhaltet) sein"

Was ich nicht übersetzen konnte:
Code:
%
%%
% .cxx.obj:
%    $(CXX) -c $(CFLAGS) $(INCLUDE) %s /Fo$*.obj
%
% .c.obj:
%    $(CC) -c $(CFLAGS) $(INCLUDE) %s /Fo$*.obj
%
% clean:
%    del  *.obj
%    
% all: Bsp1_MP.exe
%  
% SRC = simple_ode.cpp \
%    $(SNFW_SRC)
%
% OBJ = simple_ode.obj \
%   $(SNFW_OBJ)
%
% simple_ode.exe: $(OBJ) $(PSOPT)\lib\libpsopt.lib $(DMATRIX)\lib\libdmatrix.lib
%    $(LD)  -out:simple_ode.exe $(OBJ) $(LIBS)  /NODEFAULTLIB:"LIBC.lib" /DEFAULTLIB:"LIBCMT.lib"




wenn ich jedoch nun den Matlab-code von "matlabSCRIPT.m" ausführen lasse kommt folgende Fehlermeldung



Code:
%Command Window
-> Default options filename found in C:\Users\manuel\AppData\Roaming\MathWorks\MATLAB\R2013b
----------------------------------------------------------------
->    Options file           = C:\Users\manuel\AppData\Roaming\MathWorks\MATLAB\R2013b\mexopts.bat
      MATLAB                 = C:\Program Files\MATLAB\R2013b
->    COMPILER               = cl
->    Compiler flags:
         COMPFLAGS           = /c /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           =  -DDEBUG -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\src\ -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\csrc -IC:\Ipopt-3.9.3\include\coin -IC:\Ipopt-3.9.3\Ipopt\src\Interfaces -IC:\Ipopt-3.9.3\Ipopt\src\Common -IC:\Ipopt-3.9.3\BuildTools\headers -IC:\Ipopt-3.9.3\Ipopt\src\LinAlg -IC:\ADOL-C-2.1.12\ADOL-C\ -IC:\ADOL-C-2.1.12\ADOL-C\\adolc -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\drivers -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\sparse-LC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib
         Name switch         = /Fo
->    Pre-linking commands   =  
->    LINKER                 = link
->    Link directives:
         LINKFLAGS           = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2013b\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 /manifest /incremental:NO /implib:"C:\Users\manuel\AppData\Local\Temp\mex_ODcDON\templib.x" /MAP:"simple_ode.mexw64.map"
         LINKDEBUGFLAGS      = /debug /PDB:"simple_ode.mexw64.pdb"
         LINKFLAGSPOST       =  
         Name directive      = /out:"simple_ode.mexw64"
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  = @
->    Resource Compiler      = rc /fo "mexversion.res"
->    Resource Linker        =  
----------------------------------------------------------------
 
 
--> cl  -DDEBUG -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\src\ -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\csrc -IC:\Ipopt-3.9.3\include\coin -IC:\Ipopt-3.9.3\Ipopt\src\Interfaces -IC:\Ipopt-3.9.3\Ipopt\src\Common -IC:\Ipopt-3.9.3\BuildTools\headers -IC:\Ipopt-3.9.3\Ipopt\src\LinAlg -IC:\ADOL-C-2.1.12\ADOL-C\ -IC:\ADOL-C-2.1.12\ADOL-C\\adolc -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\drivers -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\sparse-LC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\manuel\AppData\Local\Temp\mex_ODcDON\simple_ode.obj -I"C:\Program Files\MATLAB\R2013b\extern\include" -I"C:\Program Files\MATLAB\R2013b\simulink\include" /O2 /Oy- /DNDEBUG simple_ode.cpp
 
simple_ode.cpp
C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include\dmatrixv.h(109) : warning C4067: Unerwartete Token nach Pr„prozessordirektive - Zeilenvorschub erwartet.
C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include\dmatrixv.h(109) : fatal error C1083: Datei (Include) kann nicht ge”ffnet werden: "mem.h": No such file or directory
 
  C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Compile of 'simple_ode.cpp' failed.
 
Unable to complete successfully.

Error in matlabSCRIPT (line 83)
eval(['mex ' MEXFLAGS ' ' SRC ...



hat jemand einen Tipp für mich wie ich eine solche funktionierende mex-Funktion für Matlab erstellen kann?


LG
manuel

Matlab_mit_PSOPT.rar
 Beschreibung:
alle Dateien

Download
 Dateiname:  Matlab_mit_PSOPT.rar
 Dateigröße:  4.42 KB
 Heruntergeladen:  311 mal
Private Nachricht senden Benutzer-Profile anzeigen


mpla
Themenstarter

Forum-Newbie

Forum-Newbie


Beiträge: 4
Anmeldedatum: 08.01.14
Wohnort: Oberösterreich
Version: ---
     Beitrag Verfasst am: 15.01.2014, 11:35     Titel:
  Antworten mit Zitat      
Habe einen Fehler gefunden.
Die CFLAGS = '-DWIN32 -DLAPACK -DSPARSE_MATRIX -DUSE_IPOPT -DUSE_SNOPT -D_CRT_ERRNO_DEFINED'; habe ich nicht richtig angegeben.

nun funktioniert schon mehr, jedoch bekomme ich folgende Fehlermeldung
Code:

-> Default options filename found in C:\Users\manuel\AppData\Roaming\MathWorks\MATLAB\R2013b
----------------------------------------------------------------
->    Options file           = C:\Users\manuel\AppData\Roaming\MathWorks\MATLAB\R2013b\mexopts.bat
      MATLAB                 = C:\Program Files\MATLAB\R2013b
->    COMPILER               = cl
->    Compiler flags:
         COMPFLAGS           = /c /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           =  -DWIN32 -DLAPACK -DSPARSE_MATRIX -DUSE_IPOPT -DUSE_SNOPT -D_CRT_ERRNO_DEFINED -DDEBUG -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\src\ -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\csrc -IC:\Ipopt-3.9.3\include\coin -IC:\Ipopt-3.9.3\Ipopt\src\Interfaces -IC:\Ipopt-3.9.3\Ipopt\src\Common -IC:\Ipopt-3.9.3\BuildTools\headers -IC:\Ipopt-3.9.3\Ipopt\src\LinAlg -IC:\ADOL-C-2.1.12\ADOL-C\ -IC:\ADOL-C-2.1.12\ADOL-C\\adolc -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\drivers -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\sparse-LC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib
         Name switch         = /Fo
->    Pre-linking commands   =  
->    LINKER                 = link
->    Link directives:
         LINKFLAGS           = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2013b\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 /manifest /incremental:NO /implib:"C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\templib.x" /MAP:"simple_ode.mexw64.map"
         LINKDEBUGFLAGS      = /debug /PDB:"simple_ode.mexw64.pdb"
         LINKFLAGSPOST       =  
         Name directive      = /out:"simple_ode.mexw64"
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  = @
->    Resource Compiler      = rc /fo "mexversion.res"
->    Resource Linker        =  
----------------------------------------------------------------
 
 
--> cl  -DWIN32 -DLAPACK -DSPARSE_MATRIX -DUSE_IPOPT -DUSE_SNOPT -D_CRT_ERRNO_DEFINED -DDEBUG -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\src\ -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include -IC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\csrc -IC:\Ipopt-3.9.3\include\coin -IC:\Ipopt-3.9.3\Ipopt\src\Interfaces -IC:\Ipopt-3.9.3\Ipopt\src\Common -IC:\Ipopt-3.9.3\BuildTools\headers -IC:\Ipopt-3.9.3\Ipopt\src\LinAlg -IC:\ADOL-C-2.1.12\ADOL-C\ -IC:\ADOL-C-2.1.12\ADOL-C\\adolc -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\drivers -IC:\ADOL-C-2.1.12\ADOL-C\\adolc\sparse-LC:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\simple_ode.obj -I"C:\Program Files\MATLAB\R2013b\extern\include" -I"C:\Program Files\MATLAB\R2013b\simulink\include" /O2 /Oy- /DNDEBUG simple_ode.cpp
 
simple_ode.cpp
C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include\cs.h(422) : warning C4190: 'cs_ci_house' hat C-Bindung angegeben, aber gibt UDT 'std::complex<double>' zurck, was mit C inkompatibel ist
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\complex(668): Siehe Deklaration von 'std::complex<double>'
C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSPARSE\Include\cs.h(562) : warning C4190: 'cs_cl_house' hat C-Bindung angegeben, aber gibt UDT 'std::complex<double>' zurck, was mit C inkompatibel ist
        C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\complex(668): Siehe Deklaration von 'std::complex<double>'
simple_ode.cpp(76) : warning C4244: 'Initialisierung': Konvertierung von 'double' in 'int', m”glicher Datenverlust
    Contents of C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\mex_tmp.rsp:
  C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\simple_ode.obj
 
 
--> link /out:"simple_ode.mexw64" /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2013b\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 /manifest /incremental:NO /implib:"C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\templib.x" /MAP:"simple_ode.mexw64.map"  @C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\mex_tmp.rsp  C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\libdmatrix.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\lib\libpsopt.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\clapack.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\blas.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\libf2c.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libIpopt\Release\libIpopt.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libf2c\vcf2c.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\LibCoinLapack\Release\libCoinLapack.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libCoinBlas\Release\libCoinBlas.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libCoinHSL\Release\libCoinHSL.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\liblusol.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSparse\Lib\libcxsparse.lib C:\ADOL-C-2.1.12\windows\sparse\adolc.lib C:\snopt7\win32\snopt.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libf2c\vcf2c.lib  
 
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __cdecl std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QEAAPEAV123@XZ) ist bereits in libIpopt.lib(IpIpoptApplication.obj) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPEAV123@@Z) ist bereits in msvcprt.lib(locale0_implib.obj) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPEAV_Locimp@12@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QEAA@H@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
LIBCMT.lib(tidtable.obj) : error LNK2005: _encoded_null ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(dosmap.obj) : error LNK2005: _errno ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(crtheap.obj) : error LNK2005: _malloc_crt ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(crt0dat.obj) : error LNK2005: exit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(crt0dat.obj) : error LNK2005: _amsg_exit ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(mlock.obj) : error LNK2005: _unlock ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(mlock.obj) : error LNK2005: _lock ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(winxfltr.obj) : error LNK2005: __CppXcptFilter ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(atox.obj) : error LNK2005: atoi ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(winsig.obj) : error LNK2005: signal ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_a ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
LIBCMT.lib(crt0init.obj) : error LNK2005: __xi_z ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_a ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
LIBCMT.lib(crt0init.obj) : error LNK2005: __xc_z ist bereits in MSVCRT.lib(cinitexe.obj) definiert.
LIBCMT.lib(tolower.obj) : error LNK2005: tolower ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
LIBCMT.lib(strtol.obj) : error LNK2005: strtol ist bereits in MSVCRT.lib(MSVCR100.dll) definiert.
   Bibliothek "C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\templib.x" und Objekt "C:\Users\manuel\AppData\Local\Temp\mex_jtQDZ_\templib.exp" werden erstellt.
LINK : warning LNK4098: Standardbibliothek "MSVCRT" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
LINK : warning LNK4098: Standardbibliothek "LIBCMT" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
libpsopt.lib(psopt.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "snopenappend_" in Funktion ""int __cdecl NLP_interface(struct alg_str &,class DMatrix *,double (__cdecl*)(class DMatrix &),void (__cdecl*)(class DMatrix &,class DMatrix *),int,int,class DMatrix *,class DMatrix *,class DMatrix *,int,int)" (?NLP_interface@@YAHAEAUalg_str@@PEAVDMatrix@@P6ANAEAV2@@ZP6AX21@ZHH111HH@Z)".
libf2c.lib(main1.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "MAIN__" in Funktion "main".
simple_ode.mexw64 : fatal error LNK1120: 2 nicht aufgelöste externe Verweise.
 
  C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Link of 'simple_ode.mexw64' failed.
 
Unable to complete successfully.

Error in matlabSCRIPT (line 83)
eval(['mex ' MEXFLAGS ' ' SRC ...
 


hat dies was mit
Code:

CXX = 'cl';
CC  = 'cl';
LD  = 'link';
 

in matlabSCRIPT.m zu tun?
oder
Code:

%
%%
% .cxx.obj:
%    $(CXX) -c $(CFLAGS) $(INCLUDE) %s /Fo$*.obj
%
% .c.obj:
%    $(CC) -c $(CFLAGS) $(INCLUDE) %s /Fo$*.obj
%
% clean:
%    del  *.obj
%    
% all: Bsp1_MP.exe
%  
% SRC = simple_ode.cpp \
%    $(SNFW_SRC)
%
% OBJ = simple_ode.obj \
%   $(SNFW_OBJ)
%
% simple_ode.exe: $(OBJ) $(PSOPT)\lib\libpsopt.lib $(DMATRIX)\lib\libdmatrix.lib
%    $(LD)  -out:simple_ode.exe $(OBJ) $(LIBS)  /NODEFAULTLIB:"LIBC.lib" /DEFAULTLIB:"LIBCMT.lib"
 

in matlabSCRIPT.m zu tun?

lg
manuel
Private Nachricht senden Benutzer-Profile anzeigen
 
mpla
Themenstarter

Forum-Newbie

Forum-Newbie


Beiträge: 4
Anmeldedatum: 08.01.14
Wohnort: Oberösterreich
Version: ---
     Beitrag Verfasst am: 15.01.2014, 13:28     Titel:
  Antworten mit Zitat      
oder hat es jemand geschafft, in Visual Studio ein makefile-Projekt anzulegen welches die Beispiele compilieren kann??

LG
manuel
Private Nachricht senden Benutzer-Profile anzeigen
 
mpla
Themenstarter

Forum-Newbie

Forum-Newbie


Beiträge: 4
Anmeldedatum: 08.01.14
Wohnort: Oberösterreich
Version: ---
     Beitrag Verfasst am: 16.01.2014, 16:20     Titel: linker - Problem
  Antworten mit Zitat      
compilieren funktioniert, aber mit dem linken hat Matlab Probleme:
Code:

--> link /out:"simple_ode.mexw64" /dll /export:mexFunction /LIBPATH:"C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\lib" libpsopt.lib /LIBPATH:"C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib" libdmatrix.lib /LIBPATH:"C:\Program Files\MATLAB\R2013b\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 /manifest /incremental:NO /implib:"C:\Users\manuel\AppData\Local\Temp\mex_fi4fmg\templib.x" /MAP:"simple_ode.mexw64.map" /NODEFAULTLIB:MSVCRT.lib /DEFAULTLIB:"LIBCMT.lib"  @C:\Users\manuel\AppData\Local\Temp\mex_fi4fmg\mex_tmp.rsp  C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\libdmatrix.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\lib\libpsopt.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\clapack.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\blas.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib\libf2c.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libIpopt\Release\libIpopt.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libf2c\vcf2c.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\LibCoinLapack\Release\libCoinLapack.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libCoinBlas\Release\libCoinBlas.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libCoinHSL\Release\libCoinHSL.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\lusol\liblusol.lib C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\CXSparse\Lib\libcxsparse.lib C:\ADOL-C-2.1.12\windows\sparse\adolc.lib C:\snopt7\win32\snopt.lib C:\Ipopt-3.9.3\Ipopt\MSVisualStudio\v8\libf2c\vcf2c.lib  
 
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: class std::locale::facet * __cdecl std::locale::facet::_Decref(void)" (?_Decref@facet@locale@std@@QEAAPEAV123@XZ) ist bereits in libIpopt.lib(IpIpoptApplication.obj) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static void __cdecl std::locale::facet::_Facet_Register(class std::locale::facet *)" (?_Facet_Register@facet@locale@std@@CAXPEAV123@@Z) ist bereits in msvcprt.lib(locale0_implib.obj) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Getgloballocale(void)" (?_Getgloballocale@locale@std@@CAPEAV_Locimp@12@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_dtor(class std::_Locinfo *)" (?_Locinfo_dtor@_Locinfo@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "public: static void __cdecl std::_Locinfo::_Locinfo_ctor(class std::_Locinfo *,char const *)" (?_Locinfo_ctor@_Locinfo@std@@SAXPEAV12@PEBD@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(locale0.obj) : error LNK2005: "private: static class std::locale::_Locimp * __cdecl std::locale::_Init(void)" (?_Init@locale@std@@CAPEAV_Locimp@12@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(ios.obj) : error LNK2005: "public: static void __cdecl std::ios_base::_Addstd(class std::ios_base *)" (?_Addstd@ios_base@std@@SAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(ios.obj) : error LNK2005: "private: static void __cdecl std::ios_base::_Ios_base_dtor(class std::ios_base *)" (?_Ios_base_dtor@ios_base@std@@CAXPEAV12@@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QEAA@H@Z) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
libcpmt.lib(xlock.obj) : error LNK2005: "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) ist bereits in msvcprt.lib(MSVCP100.dll) definiert.
   Bibliothek "C:\Users\manuel\AppData\Local\Temp\mex_fi4fmg\templib.x" und Objekt "C:\Users\manuel\AppData\Local\Temp\mex_fi4fmg\templib.exp" werden erstellt.
simple_ode.obj : warning LNK4217: Lokal definiertes Symbol "??0exception@std@@QEAA@AEBQEBD@Z (public: __cdecl std::exception::exception(char const * const &))" wurde in "public: __cdecl std::bad_alloc::bad_alloc(char const *)" (??0bad_alloc@std@@QEAA@PEBD@Z)-Funktion importiert.
simple_ode.obj : warning LNK4217: Lokal definiertes Symbol "??1exception@std@@UEAA@XZ (public: virtual __cdecl std::exception::~exception(void))" wurde in "public: virtual __cdecl std::bad_alloc::~bad_alloc(void)" (??1bad_alloc@std@@UEAA@XZ)-Funktion importiert.
simple_ode.obj : warning LNK4217: Lokal definiertes Symbol "memmove" wurde in "public: static char * __cdecl std::char_traits<char>::move(char *,char const *,unsigned __int64)" (?move@?$char_traits@D@std@@SAPEADPEADPEBD_K@Z)-Funktion importiert.
simple_ode.obj : warning LNK4217: Lokal definiertes Symbol "??0exception@std@@QEAA@AEBV01@@Z (public: __cdecl std::exception::exception(class std::exception const &))" wurde in "public: __cdecl std::bad_alloc::bad_alloc(class std::bad_alloc const &)" (??0bad_alloc@std@@QEAA@AEBV01@@Z)-Funktion importiert.
libpsopt.lib(psopt.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "snopenappend_" in Funktion ""int __cdecl NLP_interface(struct alg_str &,class DMatrix *,double (__cdecl*)(class DMatrix &),void (__cdecl*)(class DMatrix &,class DMatrix *),int,int,class DMatrix *,class DMatrix *,class DMatrix *,int,int)" (?NLP_interface@@YAHAEAUalg_str@@PEAVDMatrix@@P6ANAEAV2@@ZP6AX21@ZHH111HH@Z)".
simple_ode.mexw64 : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.
 
  C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Link of 'simple_ode.mexw64' failed.
 
Unable to complete successfully.

Error in matlabSCRIPT (line 87)
eval(['mex ' MEXFLAGS ' ' SRC ...
 





IN mexobts.bat


Code:

rem ********************************************************************
rem Linker parameters
rem ********************************************************************
set LIBLOC=%MATLAB%\extern\lib\win64\microsoft
set LINKER=link
rem ********************************************************************   changed by Manuel PLAINER 16.01.2014
rem set LINKFLAGS=/dll /export:%ENTRYPOINT% /LIBPATH:"%LIBLOC%" 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 /manifest /incremental:NO /implib:"%LIB_NAME%.x" /MAP:"%OUTDIR%%MEX_NAME%%MEX_EXT%.map"
rem set LINKFLAGS=/dll /export:%ENTRYPOINT% /LIBPATH:"%LIBLOC%" 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 /manifest /incremental:NO /implib:"%LIB_NAME%.x" /MAP:"%OUTDIR%%MEX_NAME%%MEX_EXT%.map" /NODEFAULTLIB:MSVCRT.lib /DEFAULTLIB:"LIBCMT.lib"
set DMATRIXlib=C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\dmatrix\lib
set PSOPTlib=C:\Users\manuel\Dropbox\Studium\Automatisierungstechnik\DIPLOMARBEIT\SOFTWAREOptimiererIPOPT_SNOPT_PSOPT_AMPL\PSOPT\Psopt3\PSOPT\lib
rem /LIBPATH:"%PSOPTlib%" libpsopt.lib /LIBPATH:"%DMATRIXlib%" libdmatrix.lib
rem /NODEFAULTLIB:MSVCRT.lib /DEFAULTLIB:"LIBCMT.lib"
set LINKFLAGS=/dll /export:%ENTRYPOINT% /LIBPATH:"%PSOPTlib%" libpsopt.lib /LIBPATH:"%DMATRIXlib%" libdmatrix.lib /LIBPATH:"%LIBLOC%" 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 /manifest /incremental:NO /implib:"%LIB_NAME%.x" /MAP:"%OUTDIR%%MEX_NAME%%MEX_EXT%.map" /NODEFAULTLIB:MSVCRT.lib /DEFAULTLIB:"LIBCMT.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=@
 


habe ich diversucht die Zeilen des Makefiles:
Code:

all: simple_ode.exe

SRC = simple_ode.cpp \
   $(SNFW_SRC)

OBJ = simple_ode.obj \
  $(SNFW_OBJ)

simple_ode.exe: $(OBJ) $(PSOPT)\lib\libpsopt.lib $(DMATRIX)\lib\libdmatrix.lib
   $(LD)  -out:simple_ode.exe $(OBJ) $(LIBS)  /NODEFAULTLIB:"LIBC.lib" /DEFAULTLIB:"LIBCMT.lib"
 


richtig zu übersetzten aber ledier ohne Erfolg.
beim Befehl mex -c ... -> wird die obj-Datei ohne Fehlermeldung erzeugt -> beim Linken gibt es Probleme


lg
manuel
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2025 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.