[MacPorts] #41588: Boost.Regex with GCC broken on Mavericks?
MacPorts
noreply at macports.org
Mon Dec 2 04:34:54 PST 2013
#41588: Boost.Regex with GCC broken on Mavericks?
------------------------------+--------------------------------
Reporter: akim.demaille@… | Owner: macports-tickets@…
Type: defect | Status: closed
Priority: Normal | Milestone:
Component: ports | Version: 2.2.1
Resolution: invalid | Keywords: mavericks
Port: boost |
------------------------------+--------------------------------
Comment (by akim.demaille@…):
Replying to [comment:9 ryandesign@…]:
> Therefore, compile your own code using the system's libstdc++ too; don't
use FSF GCC's libstdc++.
I'd be happy to do that, but as of today, this is not possible on Mac
Ports, because the system's lib for C++ is libstdc++, but if I don't pass
-stdlib=c++, then c++ (the native C++ compiler) does not support C++11.
So:
- GCC is not an option, as it does not use the system's library:
{{{
$ cat /tmp/foo.cc
#include <memory>
#include <boost/filesystem.hpp>
#include <iostream>
int main()
{
auto p = std::make_shared<boost::filesystem::path>("abc");
std::cerr << p->is_absolute() << std::endl;
std::cerr << absolute(*p) << std::endl;
}
$ g++-mp-4.8 -std=c++11 -ggdb -Wall foo.cc -lboost_filesystem-mt
-lboost_system-mt -L/opt/local/lib -I/opt/local/include
$ ./a.out
a.out(82426) malloc: *** error for object 0x108bc4570: pointer being freed
was not allocated
*** set a breakpoint in malloc_error_break to debug
zsh: abort ./a.out
}}}
- clang is not an option, where from Xcode or from MacPorts, because its
system's library does not support C++11
{{{
$ c++ -std=c++11 -ggdb -Wall foo.cc -lboost_filesystem-mt -lboost_system-
mt -L/opt/local/lib -I/opt/local/include
foo.cc:7:17: error: no member named 'make_shared' in namespace 'std'
auto p = std::make_shared<boost::filesystem::path>("abc");
~~~~~^
foo.cc:7:52: error: expected '(' for function-style cast or type
construction
auto p = std::make_shared<boost::filesystem::path>("abc");
~~~~~~~~~~~~~~~~~~~~~~~^
2 errors generated.
$ c++ -std=c++11 -stdlib=libc++ -ggdb -Wall foo.cc -lboost_filesystem-mt
-lboost_system-mt -L/opt/local/lib -I/opt/local/include
$ ./a.out
zsh: segmentation fault ./a.out
}}}
So, unless I missed an option, one cannot use Boost and C++11 on MacPorts
today.
--
Ticket URL: <https://trac.macports.org/ticket/41588#comment:10>
MacPorts <http://www.macports.org/>
Ports system for OS X
More information about the macports-tickets
mailing list