Undefined symbols for architecture x86_64:
"H5::H5File::H5File(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned int, H5::FileCreatPropList const&, H5::FileAccPropList const&)", referenced from:
_main in create-ruwH6L.o
"H5::CommonFG::createDataSet(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, H5::DataType const&, H5::DataSpace const&, H5::DSetCreatPropList const&) const", referenced from:
_main in create-ruwH6L.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error comes from H5std_string which is a typedef for std::string in H5Exception.h . The std::string has been changed in c++11, and hdf5 is compiled without hdf5 support and so uses old c++-03 string.
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
works well, but it links with an old libc (since in fact there are no c++11 features used). The libc++ manual at http://libcxx.llvm.org/ says to use both.
Once I put something like
#include <memory>
std::unique_ptr a1;
into create.cpp the compilation without "--stdlib=libc++" breaks and says
../create.cpp:34:6: error: no type named 'unique_ptr' in namespace 'std'
std::unique_ptr<int> a1;
~~~~~^
../create.cpp:34:16: error: expected unqualified-id
std::unique_ptr<int> a1;
Here you are changing two things at once: -std=c++11 -stdlib=libc++. What if you build as C++11 but don't specify libc++?
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Here you are changing two things at once: -std=c++11 -stdlib=libc++. What if you build as C++11 but don't specify libc++?
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
As Apple is no longer doing anything GNU, the version of libstdc++ they use is very old and has no/little C++11 support.
(since in fact there are no c+
+11 features used). The libc++ manual at http://libcxx.llvm.org/ says
to use both.
Sure, but trying one at a time shows us that your problem is HDF5&libc++ not HDF5&C++11.
What if you build with -std=c++03 -stdlib=libc++ ?
Cheers,
···
On Mon, 29 Jul 2013 17:21:07 +0200, Andrey Antipov said:
--
____________________________________________________________
Sean McBride, B. Eng sean@rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
Manually rebuilding hdf5 with CXX="clang++ -std=c++11 -stdlib=libc++" makes this compilation work.
As most package managers like homebrew or macports doesn't have the compilation with c++11 by default and libc++ is abi-compatible with standard stdlibc++, I suppose this issue might be forwarded directly to them.