failed to build with clang on FreeBSD 10 or OS X
Brought to you by:
mcvsubbu
Build with clang failing with such error message:
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-am
clang++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c -o yconalyzer.o yconalyzer.cc
yconalyzer.cc:81:17: error: expected namespace name
using namespace _GLIBCXX_STD;
^
yconalyzer.cc:195:9: error: no template named 'map'; did you mean 'std::map'?
typedef map<int, int> addrhash;
^~~
std::map
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:783:29: note: 'std::map' declared here
class _LIBCPP_TYPE_VIS_ONLY map
^
yconalyzer.cc:196:9: error: no template named 'map'; did you mean 'std::map'?
typedef map<std::string, struct conndet *> connhash;
^~~
std::map
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:783:29: note: 'std::map' declared here
class _LIBCPP_TYPE_VIS_ONLY map
^
yconalyzer.cc:197:9: error: no template named 'map'; did you mean 'std::map'?
typedef map<unsigned long, unsigned long> nsynshash;
^~~
std::map
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:783:29: note: 'std::map' declared here
class _LIBCPP_TYPE_VIS_ONLY map
^
yconalyzer.cc:224:8: error: no template named 'vector'; did you mean 'std::vector'?
static vector <struct portdet> portsvec;
^~~~~~
std::vector
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:481:29: note: 'std::vector' declared here
class _LIBCPP_TYPE_VIS_ONLY vector
^
yconalyzer.cc:1121:3: error: no template named 'vector'; did you mean 'std::vector'?
vector<struct portdet>::const_iterator it;
^~~~~~
std::vector
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:481:29: note: 'std::vector' declared here
class _LIBCPP_TYPE_VIS_ONLY vector
^
yconalyzer.cc:1292:3: error: no template named 'vector'; did you mean 'std::vector'?
vector<struct portdet>::const_iterator it;
^~~~~~
std::vector
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1225:53: note: 'std::vector' declared here
template <class _Tp, class _Alloc> friend class vector;
^
yconalyzer.cc:1331:3: error: no template named 'vector'; did you mean 'std::vector'?
vector<struct portdet>::const_iterator it;
^~~~~~
std::vector
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/iterator:1225:53: note: 'std::vector' declared here
template <class _Tp, class _Alloc> friend class vector;
^
8 errors generated.
make[1]: *** [yconalyzer.o] Error 1
make: *** [all] Error 2
With patch from FreeBSD project it compiles and works well.