Verfasst am: 08.01.2014, 14:52
Titel: PSOPT C/C++ Projekt - mit mex -> Unable to complete succe
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"
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 Prprozessordirektive - 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 geffnet werden: "mem.h": No such file or directory
C:\PROGRA~1\MATLAB\R2013B\BIN\MEX.PL: Error: Compile of 'simple_ode.cpp' failed.
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
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>' zurck, 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>' zurck, 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', mglicher 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
msvcprt.lib(MSVCP100.dll) : error LNK2005: "public: classstd::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(classstd::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 classstd::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(classstd::_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(classstd::_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 classstd::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(classstd::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(classstd::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.
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
Einstellungen und Berechtigungen
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
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.