2015-04-13 3 views
0

при компиляции файла mex a получить указанную выше ошибку. Я использую MATLAB2013 с mex-компилятором: Microsoft SDK 7.1. Я надеюсь, что следующие отладки информация, которая была напечатана компилятором может быть полезным:Ошибка компиляции mex: Неопознанный переключатель: -cxx

vl_compilenn: * Compiler and linker configurations * 
vl_compilenn: intermediate build products directory: 
C:\Dima \Projects_C \Libraries\matconvnet\matlab\mex\.build 
vl_compilenn: MEX files: C:\Dima\Projects_C\Libraries\matconvnet\matlab 
\mex/ 
vl_compilenn: MEX compiler options: -DNDEBUG -D__SSSE3__ -cxx 
vl_compilenn: MEX linker options: -lmwblas -lgdiplus 
vl_compilenn: * Reading images * 
vl_compilenn: vl_imreadjpeg enabled 
vl_compilenn: image library: gdiplus 
vl_compilenn: image library compile flags: 
vl_compilenn: image library link flags: -lgdiplus 
vl_compilenn: MEX: -outdir C:\Dima\Projects_C\Libraries\matconvnet\matlab 
\mex\.build matlab\src\vl_imreadjpeg.cpp -c -DNDEBUG -D__SSSE3__ -cxx 
Usage: 
    MEX [option1 ... optionN] sourcefile1 [... sourcefileN] 
     [objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN] 

Use the -help option for more information, or consult the MATLAB API Guide. 


C:\PROGRA~1\MATLAB\R2013A\BIN\MEX.PL: Error: Unrecognized switch: -cxx 
+2

Какую команду вы используете для компиляции? – Daniel

+0

Я использую команду mex – user3884651

+0

Без каких-либо дополнительных флагов? Холодный вы представляете полный пример, чтобы воспроизвести вашу проблему? – Daniel

ответ

2

Вот помощь для опции -cxx командной строки MEX:

Command Line Options Available Only on UNIX Platforms: 
    -cxx 
     Use the C++ linker to link the mex-file if the first source file 
     is in C and there are one or more C++ source or object files. This 
     option overrides the assumption that the first source file in 
     the list determines which linker to use. 

Как вы можете видеть, это говорит, что -cxx доступен только на платформах UNIX. Я не думаю, что вам нужно что-то сделать для компиляции C++ MEX в Windows; просто назовите mex так, как вы были, но без -cxx.

Смежные вопросы