[PATCH] Prevent crash in Mac OS X when opening project

Wolfgang Bangerth bangerth at math.tamu.edu
Tue Feb 7 07:40:16 UTC 2012


> While I agree that the patch makes sense as a way to avoid crashing
> kdevelop due to bugs elsewhere it also does hide such a bug. So we
> should first find out why the dynamic-cast fails in your case before
> applying such a 'workaround'.

For our project we had similar observations and have a small testcase. 
Take the attached files and execute the commands
       $CXX -dynamiclib BaseClass.cpp -o libDynamicCastTestLib.dylib
       $CXX -L. -lDynamicCastTestLib main.cc -o main
       ./main
and see what the return code is. On some Mac OS X versions, the dynamic 
cast appears to fail if the RTTI information for classes is deposited in 
a shared library but is needed in an object file that links to the 
shared library.

The workaround is to pass -mmacosx-version-min=10.4 when compiling 
object files and when linking (both the shared lib and the executable, I 
believe).

Best
  W.

------------------------------------------------------------------------
Wolfgang Bangerth               email:            bangerth at math.tamu.edu
                                 www: http://www.math.tamu.edu/~bangerth/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: BaseClass.cpp
Type: text/x-c++src
Size: 666 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120207/05b6199c/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BaseClass.h
Type: text/x-chdr
Size: 384 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120207/05b6199c/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cc
Type: text/x-c++src
Size: 291 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20120207/05b6199c/attachment.cc>


More information about the KDevelop-devel mailing list