Compiling for MacOS X fails with "implicit instantiation of undefined template"

1,747 views
Skip to first unread message

Dan Piponi

unread,
Sep 22, 2014, 1:30:29 PM9/22/14
to openvd...@googlegroups.com
Trying to build OpenVDB 2.3.0 on OS X 10.9.4 with this compiler:

$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix

Gives this error message:

$ make
Building Grid.o because of Grid.cc
c++ -c -DOPENVDB_PRIVATE -pthread -O3 -DNDEBUG -I . -I .. -I /include -I /include -I /include -fPIC -o Grid.o Grid.cc
In file included from Grid.cc:31:
In file included from ./Grid.h:34:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iostream:38:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/ios:216:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__locale:1127:52: error:
      implicit instantiation of undefined template 'std::__1::basic_string<char,
      std::__1::char_traits<char>, std::__1::allocator<char> >'
        : codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}

And a lot more like it.

Anyone have any ideas how to proceed?

Dan Bailey

unread,
Sep 22, 2014, 2:16:07 PM9/22/14
to openvd...@googlegroups.com
Hi Dan,

I had quite a few issues getting OpenVDB compiled on Mavericks due to the default stdlib moving to libc++ (also I believe Houdini is still built against libstdc++ on Mac).

I got round this by adding '-mmacosx-version-min=10.7' to the CXXFLAGS being passed to Clang. It does mean re-compiling any non-SideFX dependencies with libstdc++ as well though.

Dan

Dan Piponi

unread,
Sep 22, 2014, 4:06:05 PM9/22/14
to openvd...@googlegroups.com
Thanks Dan. Turns out I managed to fix this error a different way: the Makefile adds "-I .." as a compiler flag meaning it pulls in stuff it shouldn't from a directory outside of where it's installed. Removing that fixes all of my compilation errors and results in just a linker problem with TBB: "ld: symbol(s) not found for architecture x86_64".
Reply all
Reply to author
Forward
0 new messages