Closed ryandesign closed 9 years ago
I've switched to using std::unordered_set rather than std::tr1::unordered_set; this should hopefully fix the issue. On my machine I can compile, but not link because my version of libboost-dev is compiled with libstdc++ (and it's not binary compatible with libc++). I'd be happy if you could test the latest version in the trunk and tell me if it works on a Mac (see also #2 for how to link against libboost-mt). Thanks for the reports.
Thanks. This does work on OS X 10.9 now, but would fail on any earlier version, at least using any of the compilers that come with the Apple development environment Xcode, because they all use the system's C++ library, which on OS X 10.8 and earlier is based on libstdc++ from GCC around version 4.2.1 and therefore don't understand C++11. For example on Mac OS X 10.5 using its default compiler—the Apple-modified version of GCC 4.0.1 that comes with the appropriate version of Xcode—I get:
cc1plus: error: unrecognized command line option "-std=c++11"
Using a newer GCC compiler (4.8.2) installed by MacPorts does work for me on 10.5 (because GCC compilers come bundled with a newer version of libstdc++) but I hate using up the user's time, bandwidth and disk space to install a whole new compiler. And there can sometimes be compatibility problems when mixing a newer GCC's libstdc++ with Apple's older libstdc++ in the same process (which is what happens here, since you're using boost which was compiled with the system's libstdc++), although in this case bastet seems to run ok.
I see -- so on OS X 10.8 there is neither c++11 support, nor preliminary tr1 features? This could be a problem, as I am using a tr1 container for better performance (unordered_set
). I can switch to the tr1 implementation contained in Boost; I guess that one should work.
Let's keep this open until @ryandesign confirms it works on older Macs as well.
On OS X 10.8 and earlier, there is preliminary tr1 support. Thus bastet 0.43, without changes, compiles fine on OS X 10.8 and earlier.
I'll test your new changes soon.
Sorry for the delay. The latest commit, 2c9d978e22ea78f47e3c522ac7c11d2223a1b8b4, builds and runs fine both on OS X 10.10 (with libc++) and 10.6 (with libstdc++).
Building bastet 0.43 fails on OS X 10.9 Mavericks. With this version of OS X, Apple has switched the default C++ library from libstdc++ to libc++, which does not include experimental pre-standardization C++11 features such as the ones you're using in your code; it only supports the final C++11 standard.
If you do not have access to a Mac, you should be able to reproduce this on any other system that has libc++ available.