Sunday, 15 April 2012

c++ - Unable to compile MEX -



c++ - Unable to compile MEX -

i trying compile matlab mex files c++ source. files trying compile can found here; using windows xp on 32-bit system, matlab 2012a , have installed microsoft windows sdk v7.1 utilize compiler.

matlab outputs next error if seek compile:

>> mex -o -largearraydims osc_free_address.c osc_free_address.c osc_free_address.c(1) : error c2059: syntax error : '<' osc_free_address.c(37) : error c2015: many characters in constant osc_free_address.c(38) : error c2059: syntax error : '<' osc_free_address.c(39) : error c2015: many characters in constant osc_free_address.c(39) : error c2015: many characters in constant osc_free_address.c(39) : error c2015: many characters in constant osc_free_address.c(41) : error c2018: unknown character '0x40' osc_free_address.c(43) : error c2015: many characters in constant osc_free_address.c(44) : error c2015: many characters in constant osc_free_address.c(44) : error c2015: many characters in constant osc_free_address.c(44) : error c2015: many characters in constant osc_free_address.c(44) : error c2015: many characters in constant osc_free_address.c(46) : error c2059: syntax error : '<' osc_free_address.c(82) : fatal error c1021: invalid preprocessor command 'page' c:\progra~1\matlab\r2012a\bin\mex.pl: error: compile of 'osc_free_address.c' failed. error using mex (line 206) unable finish successfully.

i have used mex -setup setup compiler microsoft windows sdk v7.1. interestingly, although have them installed on system, matlab doesn't see ms visual studio c++ 2008 or 2010. have tried compiling lcc-win32 c 2.4.1 compiler (which is recognised matlab), same effect shown above.

i understand particular set of c++ source files might require called liblo compile (i'm not sure whether requirement @ compile-time or run-time); far i'm aware have installed these correctly, there's possibility problem might lie here too.

any help appreciated.

try renaming .c files .cpp , re-compile

>> mex -largearraydims -o osc_free_address.cpp

moreover, why don't seek build m file comes bundle (as suggested in this question)?

have downloaded , compiled liblo? might need add together include path , library path in mex command?

>> mex -largearraydims -o -i<liblo include path> -l<liblo lib path> -llo osc_free_address.cpp

c++ c matlab compiler-errors mex

No comments:

Post a Comment