[vtk-developers] libc++ problem on OSX

David Gobbi david.gobbi at gmail.com
Wed Sep 17 14:34:56 EDT 2014


VTK should be compiling just find with libc++ now, in fact I've done so
many times.  AFAIK it is an all-or-nothing thing: compile everything with
libc++, or compile everything with libstdc++.  Mixing the two will result in
link errors just like the ones that John reported.

 - David


On Wed, Sep 17, 2014 at 12:17 PM, Robert Maynard
<robert.maynard at kitware.com> wrote:
> If my memory is correct CMake doesn't have explicit global objc or objc++
> flag variables. Instead what you can try todo is to set the  COMPILE_FLAGS
> property on each mm file to be "-stdlib=libstdc++"
>
> On Wed, Sep 17, 2014 at 2:07 PM, Biddiscombe, John A. <biddisco at cscs.ch>
> wrote:
>>
>> For compatibility with some other libraries, I tried compiling paraview on
>> OSX using libc++ instead of libstdc++.
>> Everything is fine except some link errors coing from vtkCocoa... classes. I
>> have never worked with these before, but see all the classes causing me
>> trouble emanate from code which has an mm extension.
>>
>> Looking at the make rules, I cannot see anything obviously wrong, but does
>> anyone know of a reason why the vtkCocoa classes cause this trouble. Are
>> they using a libstdc++ from the system (via some cocoa related link) which I
>> can't work around?
>>
>> Thanks for any hints.
>>
>> JB
>>
>> Linking CXX shared library ../../../lib/libvtkRenderingOpenGL-pv4.2.dylib
>> Undefined symbols for architecture x86_64:
>>   "vtkObjectBase::PrintHeader(std::ostream&, vtkIndent)", referenced from:
>>       vtable for vtkCocoaRenderWindowInteractor in
>> vtkCocoaRenderWindowInteractor.mm.o
>>       vtable for vtkCocoaRenderWindow in vtkCocoaRenderWindow.mm.o
>>   "vtkObjectBase::PrintTrailer(std::ostream&, vtkIndent)", referenced
>> from:
>>       vtable for vtkCocoaRenderWindowInteractor in
>> vtkCocoaRenderWindowInteractor.mm.o
>>       vtable for vtkCocoaRenderWindow in vtkCocoaRenderWindow.mm.o
>>   "vtkOpenGLRenderWindow::PrintSelf(std::ostream&, vtkIndent)", referenced
>> from:
>>       vtkCocoaRenderWindow::PrintSelf(std::ostream&, vtkIndent) in
>> vtkCocoaRenderWindow.mm.o
>>   "vtkRenderWindowInteractor::PrintSelf(std::ostream&, vtkIndent)",
>> referenced from:
>>       vtkCocoaRenderWindowInteractor::PrintSelf(std::ostream&, vtkIndent)
>> in vtkCocoaRenderWindowInteractor.mm.o
>>   "std::string::c_str() const", referenced from:
>>       vtkCocoaRenderWindow::ReportCapabilities() in
>> vtkCocoaRenderWindow.mm.o
>>   "std::string::length() const", referenced from:
>>       vtkCocoaRenderWindow::ReportCapabilities() in
>> vtkCocoaRenderWindow.mm.o



More information about the vtk-developers mailing list