Opened 3 years ago

Closed 3 years ago

#49 closed installation issue (fixed)

Problem in compiling qpOASES on OS X with Matlab 2012b

Reported by: traversaro Owned by: ferreau
Priority: normal Milestone:
Component: Matlab interface Version: 3.1.0
Keywords: Cc:

Description

Due a problem of missing typedef's used by Matlab headers, qpOASES is not compiling on OS X with Matlab 2012b.

There is an easy workaround consisting in including the typeinfo header before including matlab headers (fix described in http://stackoverflow.com/questions/22367516/mex-compile-error-unknown-type-name-char16-t , implemented in https://github.com/robotology-dependencies/qpOASES/commit/6fd1bfa0034e53923e64e80fdf0ff591e19236fd ).

I don't know which Matlab version/operating systems combination you are supporting, anyhow I was wondering if you are interested in including such a patch in upstream qpOASES?

Change History (5)

comment:1 Changed 3 years ago by ferreau

  • Status changed from new to assigned

Thanks a lot for reporting this issue and pointing to an easy work-around. I have already put your modification into the current development trunk, though I commented out the #include <typeinfo> line. This is because I am not familiar with the typeinfo header and I do not know whether it is available on all platforms/Matlab versions. Do you know more about this?

comment:2 Changed 3 years ago by traversaro

typeinfo is a standard header available in C++98. [1]
It is available in Visual Studio since at least the 2010 version [2],
while on GCC and Clang standard library it is available since more then 10 years.

It exports C++ RTTI functions that are not related at all with Matlab, but its effectiveness in
solving the fact that the mex interfaces uses the char16_t even if it is not define is explained in this stack overflow answer : http://stackoverflow.com/a/24174352/1379427 .

[1] : http://en.cppreference.com/w/cpp/header/typeinfo
[2] : https://msdn.microsoft.com/en-us/library/ee383693%28v=vs.100%29.aspx
[3] :

comment:3 Changed 3 years ago by traversaro

Notice that given that this is an OS X specific workaround, you can wrap the inclusion with an appropriate preprocessor check:

#ifdef __APPLE__
#include <typeinfo>
#endif 

comment:4 Changed 3 years ago by ferreau

Thanks again for the additional information. I have just made the typeinfo header be included by default on OS X platforms as you suggested. It part of the trunk from revision 194.

comment:5 Changed 3 years ago by ferreau

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.