Hi,
I am on the following platform:
Linux 2.6.0-test5 #11 Wed Sep 10 20:28:31 CEST 2003 i686 unknown
Reading specs from /usr/lib/gcc-lib/i386-slackware-linux/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/usr --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld
--verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
gcc version 3.2.2
Boost version 1.30.2 compiled with: bjam "-sTOOLS=gcc"
I have a question regarding the following boost::filesystem use case:
try
{
for(fs::directory_iterator dir_itr(full_path);
dir_itr != end_iter; ++dir_itr )
{
// use dir_itr
}
}
catch(const std::exception &ex)
{
std::cout << ex.what() << std::endl;
}
In case of full_path pointed to the directory without read permissions the
corresponding exception is thrown and catched in the catch block.
My problem is that if I compile my application with -fPIC option, I am unable
to catch the exception anymore and the program is simply aborted. I need to
use -fPIC because of other library which has own build system and if I follow
suggested guidlines for Makefile, I get -fPIC automatically.
I would verry appreciate if somebody could tell me are there any ways to make
the code mentioned above work when it is compiled with -fPIC? Should I
recompile boost with -fPIC? If yes, what is the right place to set this
parameter? BTW how it is supposed to write a shared library which includes
boost code? As I understand, than my code must be compiled with -fPIC...
Thanks,
Andrey.
P.S.
Here is example I am using and the makefile:
// ttt.cpp
#include <iostream>
#include
participants (1)
-
Andrey Nechypurenko