
Compiling with xcode on OS X, and targeting a cocoa, objective c++ application, we've had some configuration trouble with boost (shared_ptr in particular) not compiling with multithreaded support. This seems to come down to a problem in the "file boost/config/platform/macos.hpp" which has the lines: # ifndef TARGET_CARBON # include <boost/config/posix_features.hpp> # endif Because TARGET_CARBON is defined as part of Apple's framework (which I think is normal for a cocoa application), "posix_features.hpp" doesn't get a chance to make sure BOOST_HAS_THREADS gets defined. Posting [1] to this list indicates that the "ifndef TARGET_CARBON" was added as a work around for codewarrior's environment, and [2] mentions that there's a problem with it as a solution. I've patched this based on a suggestion by Glen Simmons (thanks) by: * creating a modified copy of "macos.hpp" that always includes "posix_features.hpp", * define BOOST_PLATFORM_CONFIG (in our prefix file) to point at the patch. Of course, it would be splendid if boost figured all this out itself. I'd be more than happy to test out an official fix. Cheers, Benjohn Barnes [1] http://lists.boost.org/MailArchives/boost-users/msg02664.php [2] http://lists.boost.org/MailArchives/boost-users/msg07979.php

Of course, it would be splendid if boost figured all this out itself. I'd be more than happy to test out an official fix.
Thanks for the report, we have a bit of a lack of MacOS X testers around here: particularly those who understand all the possible build alternatives, I'll try and get some information from Metrowerks, but in the mean time, are you able to explain: When are Mac MPTasks available. When are POSIX threads available. Ideally we need some kind of define that allows us to tell the difference between the two options. Thanks for your help, John Maddock.

Compiling with xcode on OS X, and targeting a cocoa, objective c++ application, we've had some configuration trouble with boost (shared_ptr in particular) not compiling with multithreaded support.
I've attached an updated macos.hpp based on some help provided by the folks at Metrowerks (big thanks to Howard Hinnant), which I believe will solve you gcc based problems as well, can you test this please? Thanks, John.

On 7 Feb 2005, at 11:03, John Maddock wrote:
Compiling with xcode on OS X, and targeting a cocoa, objective c++ application, we've had some configuration trouble with boost (shared_ptr in particular) not compiling with multithreaded support.
I've attached an updated macos.hpp based on some help provided by the folks at Metrowerks (big thanks to Howard Hinnant), which I believe will solve you gcc based problems as well, can you test this please?
Sorry not to reply to your questions about Mac thread availability; I'd be unable to give correct and authoritative answers. If you need more information, I'd be happy to try and find it out from the xcode list, or perhaps from some of the Omni folks. I've tried that patch out for our scode configuration, and it is correctly turning on thread support (if I include boost/config/requires_threads.hpp, I don't get an error), so it certainly fixes the configuration problem we were having. Cheers, and thanks very much for your time, Benj
participants (2)
-
Benjohn
-
John Maddock