Boost logo

Boost :

From: Christopher Cambly (ccambly_at_[hidden])
Date: 2007-11-19 14:11:29


"Gaurav Jain-SJR" <Gaurav.Jain_at_[hidden]> wrote on 11/19/2007
06:58:42 AM:

>
> Hi,
>
> // 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) <<
> '\n';
>
> 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
> -lboost_filesystem-xlc-mt-1_34
>
> ld: 0711-317 ERROR: Undefined symbol:
> .boost::filesystem::detail::last_write_time_api(
> const std::basic_string<char,std::char_traits<char>,std::allocator<char>
> >&,int)
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more
> information.
>

Disregard my advice for using the -G option, that option is for shared
libraries and likely just deferred the missing symbol until load time. Let
me take another look at the problem. The loadmap shows that the symbol is
referenced by operations_test.o (likely in samp.o in your case), but no
definition for the symbol exists.

Chris Cambly
IBM XL Compiler Development


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk