Boost logo

Boost :

From: Gaurav Jain-SJR (Gaurav.Jain_at_[hidden])
Date: 2007-11-19 06:58:42


// samp.cpp Boost Library Example
#include <iostream>
#include <string>
#include <cstdlib>
#include <fstream>
#include "boost/filesystem/operations.hpp"
#include "boost/filesystem/path.hpp"
#include "boost/filesystem/exception.hpp"
#include "boost/filesystem/convenience.hpp"
#include "boost/filesystem/fstream.hpp"
using namespace std;

int main( int argc, char* argv[] )

  if ( argc != 2 )
    std::cout << "Usage: file_size path\n";
    return 1;

  std::cout << "sizeof(intmax_t) is " << sizeof(boost::intmax_t) <<

  boost::filesystem::path p( argv[1], boost::filesystem::native );

  if ( !boost::filesystem::exists( p ) )
    std::cout << "not found: " << argv[1] << std::endl;
    return 1;

  if ( boost::filesystem::is_directory( p ) )
    std::cout << "not a file: " << argv[1] << std::endl;
    return 1;

  std::cout << "size of " << argv[1] << " is " <<
boost::filesystem::file_size( p )
    << std::endl;
  return 0;

I tried to build the above sample which comes with BOOST File System
library on AIX 5.3. It got failed at link time.
The detail of this activity is as follow:

Compiler Details: XL C/C++ Enterprise Edition V9.0

OS Details:- AIX 5.3

Boost Version:- 1_34_0 (32 bit build)

Command for building the boost libraries:-

$bjam --v2 install toolset=vacpp --prefix=$HOME/1_34_1/32
--builddir=$HOME/tmp variant=release runtime-link=static,shared
threading=single,multi --without-python Jamfile.v2

"samp.cpp":- Compilation Command

$xlC_r -q32 -I/home/1_34_0/include samp.cpp -L/home/1_34_0/lib

ld: 0711-317 ERROR: Undefined symbol:
const std::basic_string<char,std::char_traits<char>,std::allocator<char>
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more

I tried to find a solution on google and came across with the following:

Even the regression test result on IBM site indicates that the certain
test case of file system library isn't working:

I am not directly using the
"boost::filesystem::detail::last_write_time_api" in my code, but I am
not sure whether any other API's which I am using in my code, is using
it indirectly.

Can somebody suggest me a work around to resolve this?

Gaurav Jain

"There are two ways to write error-free programs; only the third works."
-Alan J. Perlis

This message contains privileged and confidential information and is intended only for an individual named. If you are not the intended recipient, you should not disseminate, distribute, store, print, copy or deliver this message. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete or contain viruses. The sender, therefore, does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. If verification is required, please request a hard-copy version.

Boost list run by bdawes at, gregod at, cpdaniel at, john at