Boost logo

Boost Users :

From: Lothar May (l-may_at_[hidden])
Date: 2007-12-06 11:31:46


Hi,

I still have no idea how to solve this problem. This time I'm using
the boost patch of the adobe open source library to build boost 1.34.1
as universal binary according to
http://opensource.adobe.com/asl_readme.html

A simple program to reproduce the problem is:

--cut here--

#include <iostream>
#include <boost/filesystem.hpp>

using namespace std;
using namespace boost::filesystem;

int
main()
{
        try
        {
                directory_iterator i("does_not_exist");
        } catch(...)
        {
                cout << "This is never printed on MacOS 10.5." << endl;
        }
        return 0;
}

--cut here--

Compile and link as follows (on MacOS 10.5):

g++ test.cpp -lboost_filesystem-mt-1_34_1 -o test

Loads of linker warnings will show up (all of them "ld: warning ...
has different visibility ...").

Run:

./test
terminate called after throwing an instance of
'boost
::filesystem
::basic_filesystem_error<boost::filesystem::basic_path<std::string,
boost::filesystem::path_traits> >'
   what(): boost::filesystem::basic_directory_iterator constructor

Is boost not supported on MacOS 10.5?

Thanks,

Lothar

On Dec 1, 2007, at 2:35 AM, Lothar May wrote:

> Hi,
>
> I'm still stuck with the uncaught exception, I have no idea what is
> going wrong there. Does anyone have any hint on what I could check?
> I tried to compile the corresponding code in Xcode (MacOS 10.5), and
> there I'm getting hundreds of link warnings like
>
> warning boost::detail::shared_count::~shared_count()has different
> visibility (2) in /Users/l-may/projects/test/build/Debug/
> libtest.a(justatest.o) and (1) in /Users/l-may/projects/test/obj/
> testapp.build/Debug/testapp.build/Objects-normal/i386/test.o
>
> Not sure whether this is related to the exception problem. Any help?
>
> Best regards,
>
> Lothar
>
>
> On Nov 24, 2007, at 9:27 PM, Lothar May wrote:
>
>> Hi,
>>
>> I have a strange problem that an exception thrown by a
>> boost::filesystem directory_iterator is not caugth on MacOS X.
>> Please consider the following code:
>>
>> ("const string &dir" is a parameter)
>>
>> bool retVal = true;
>> try
>> {
>> directory_iterator i(dir);
>> directory_iterator end;
>>
>> while (i != end)
>> {
>> // do something
>> ++i;
>> }
>> } catch (...)
>> {
>> retVal = false;
>> }
>>
>> While this works perfectly on Windows and Linux (the exception is
>> caught fine), on MacOS I get the following:
>>
>> terminate called after throwing an instance of
>> 'boost
>> ::filesystem
>> ::basic_filesystem_error<boost::filesystem::basic_path<std::string,
>> boost::filesystem::path_traits> >'
>> what(): boost::filesystem::basic_directory_iterator constructor
>> Abort trap
>>
>> The program runs fine (withouth the trap) if I comment out the
>> upper lines.
>>
>> I use the boost 1.34.0 lib built as universal binary on MacOS 10.5,
>> according to the instructions at http://svn.boost.org/trac/boost/wiki/CMakeConfigAndBuild
>>
>> I link to the static non-debug mt version of boost_filesystem.
>> Exceptions within my program are caught fine, just this boost
>> exception is not caught. The program is also compiled as non-debug.
>>
>> Any help would be very much appreciated.
>>
>> Regards,
>>
>> Lothar
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net