Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Matlab MEX Compiler Problem

Status
Not open for further replies.

agaz1985

Computer
Joined
Jun 21, 2007
Messages
3
Location
IT
I'm developing a MatLab toolbox about stereopsis, In order to compute the disparity map given two stereo images I need to use the Birchfield-Tomasi algorithm included in the OpenCV libraries. I have created a folder with all header files needed to compile the cvdpstereo.cpp file, but when I try to run the MEX compiler an error occurs :

>> mex cvdpstereo.cpp
Error cvdpstereo.cpp: .\cxtypes.h: 300 compiler error in _kids--Bad rule number 0

C:\PROGRA~1\MATLAB\R2007\BIN\MEX.PL: Error: Compile of 'cvdpstereo.cpp' failed.

??? Error using ==> mex at 206
Unable to complete successfully.


Can anyone help me please? :(
 
I'm confused. The Matlab compiler is C, not C++

TTFN

FAQ731-376
 
Given the "\" directory separator this is Windoze. That means MEX may use one of many compilers (Borland, Watcom, Intel, MSVC++, lcc, ...). If it's MSVC++ then C++ source code can be used. If lcc, only C can be used. Unfortunately I can't comment on any of the others.

(I don't see the relevance of "The Matlab compiler" though in the context of building MEX files.)
 
Sorry, but I'm newbie about MEX-File so I tried to compile the cvdpstereocorrisp.ccp directly :S Reading the documentation about mex files I have solved the problem writing a C file containing the mexFuction(...) instead of main(...),calling cvdpstereocorrisp function in MEX-File and compiling all via Visual C++ IDE (not via Matlab). Now all works perfectly, I have my MEX file that computes the disparity map. :D Thanks for yours suggests !!!!
 
Matlab has a built-in compiler, lcc, which is the default. You have to specifically change the settings to use a different compiler.

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top