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

mex - lib anhänge klappt nicht richtig

 

laternenjoe
Forum-Fortgeschrittener

Forum-Fortgeschrittener


Beiträge: 83
Anmeldedatum: 25.02.15
Wohnort: Bochum
Version: ---
     Beitrag Verfasst am: 24.01.2016, 17:50     Titel: mex - lib anhänge klappt nicht richtig
  Antworten mit Zitat      
Hallo,

Ich möchte gerne eine .mex Datei erstellen. Habe Windows 8.1 64bit, Matlab Student 2012a 32bit. ...Was mich erstmal schon "stört" ist, dass ich unter

Code:
nur den lcc Compiler zur Auswahl habe, obwohl ich zB VS2013Community installiert hab, also der Windows c++ Compiler gelistet werden müsste. Gut. Wenn ich jetzt mit
Code:

path='-Lxxx';
lib='-lmeineLib.lib';
mex(path,lib,'v','-ImeineIncludeDatei.h','meineCdatei.c')

versuche das alles zu kompilieren, klappt das nicht. Der Fehler kommt beim Linken. Wenn ich mex -o ausführen lasse klappt alles...Das Gateway habe ich in meineCdatei.c gesetzt.

Die Demos in der Matlabdoku klappen bei mir.

Fehlermeldung:

Code:

-> Default options filename found in C:\Users\xxx\AppData\Roaming\MathWorks\MATLAB\R2012a
----------------------------------------------------------------
->    Options file           = C:\Users\xxx\AppData\Roaming\MathWorks\MATLAB\R2012a\mexopts.bat
      MATLAB                 = C:\Program Files (x86)\MATLAB\R2012a Student
->    COMPILER               = lcc
->    Compiler flags:
         COMPFLAGS           = -c -I"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup
         OPTIMFLAGS          = -DNDEBUG
         DEBUGFLAGS          = -g4
         arguments           =  -IC:\Rigol_visa
         Name switch         = -Fo
->    Pre-linking commands   =  
->    LINKER                 = lcclnk
->    Link directives:
         LINKFLAGS           =  -tmpdir "." -dll "C:\Program Files (x86)\MATLAB\R2012a Student\extern\lib\win32\lcc\mexFunction.def" -L"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\lib" -libpath "C:\Program Files (x86)\MATLAB\R2012a Student\extern\lib\win32\lcc" "C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\templib2.obj"
         LINKDEBUGFLAGS      =  
         LINKFLAGSPOST       = libmx.lib libmex.lib libmat.lib
         Name directive      = -o "visa1.mexw32"
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  = @
->    Resource Compiler      = lrc -I"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\include" -noregistrylookup -fo"mexversion.res"
[color=red]->    Resource Linker        =  [/color]
----------------------------------------------------------------
 
 
--> lcc  -IC:\Rigol_visa -c -I"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup -FoC:\Users\xxx\AppData\Local\Temp\mex_MXTfab\visa1.obj -I"C:\Program Files (x86)\MATLAB\R2012a Student\extern\include" -I"C:\Program Files (x86)\MATLAB\R2012a Student\simulink\include" -DNDEBUG visa1.c
 
 
--> lcc -c -I"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\include" -DMATLAB_MEX_FILE -noregistrylookup "C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\mex\lccstub.c" -Fo"C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\templib2.obj"
 
    Contents of C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\mex_tmp.rsp:
  C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\visa1.obj
 
 
--> lcclnk -o "visa1.mexw32"  -tmpdir "." -dll "C:\Program Files (x86)\MATLAB\R2012a Student\extern\lib\win32\lcc\mexFunction.def" -L"C:\Program Files (x86)\MATLAB\R2012a Student\sys\lcc\lib" -libpath "C:\Program Files (x86)\MATLAB\R2012a Student\extern\lib\win32\lcc" "C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\templib2.obj" -s @C:\Users\xxx\AppData\Local\Temp\mex_MXTfab\mex_tmp.rsp  "C:\Program Files (x86)\MATLAB\R2012a Student\extern\lib\win32\lcc\visa32.lib" libmx.lib libmex.lib libmat.lib
 
Writing library for visa1.mexw32
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viOpenDefaultRM@4'
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viFindRsrc@20'
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viOpen@20'
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viWrite@16'
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viRead@16'
c:\users\xxx\appdata\local\temp\mex_mxtfab\visa1.obj .text: undefined reference to '_viClose@4'
 
  C:\PROGRA~2\MATLAB\R2012A~1\BIN\MEX.PL: Error: Link of 'visa1.mexw32' failed.
 



Liegt es daran, dass es eine c++ lib ist? Sollte Ich es mit einen anderen Compiler versuchen, zB in VS2013? Matlab neu installieren? Sonstwas?
Private Nachricht senden Benutzer-Profile anzeigen


Jan S
Moderator

Moderator


Beiträge: 11.057
Anmeldedatum: 08.07.10
Wohnort: Heidelberg
Version: 2009a, 2016b
     Beitrag Verfasst am: 24.01.2016, 23:34     Titel: Re: mex - lib anhänge klappt nicht richtig
  Antworten mit Zitat      
Hallo laternenjoe,

VS2013 gehört nicht zu den unterstützten Compilern für Matlab 2012a. Siehe http://www.mathworks.com/support/compilers/R2012a/win32.html.

LCC ist ein C-Compiler. Es würde mich wundern, wenn er C++ Libs einbinden kann.
Das freie Windows 7.1 SDK zu installieren wäre aber auf jeden Fall eine gute Idee.

Gruß, Jan
Private Nachricht senden Benutzer-Profile anzeigen
 
laternenjoe
Themenstarter

Forum-Fortgeschrittener

Forum-Fortgeschrittener


Beiträge: 83
Anmeldedatum: 25.02.15
Wohnort: Bochum
Version: ---
     Beitrag Verfasst am: 26.01.2016, 00:00     Titel:
  Antworten mit Zitat      
Ja, hab Probleme das SDK zu installieren, weil ich noch .net 4.5 auf dem PC habe. Hatte das auch gestern versucht, aber wenig erfolgreich. Aber da es zeitlich gerade eh eng bei mir ist, kann ich noch nicht sagen, wann Ich genau die Tage mich dran setze. Ich kann noch auf andere PCs mit Matlab und evtl. anderen Compilern zugreifen. Da werde ich es notfalls auch nocheinal drauf versuchen.
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.