Boost logo

Boost :

From: Dave Wolfe (dwolfe_at_[hidden])
Date: 2004-07-21 18:21:15

I recently tried to d/l boost_1_31_0 and compile a short test program
(appended below) on QNX 6.2.1. My first attempt to compile with:

% make bindtest CPPFLAGS=-I/home/projects/boost_1_31_0

resulted in a yard+ of errors that I was able to quiet by adding
'-ftemplate-depth-32' to CPPFLAGS. But I still got the error:

g++ -I. -ftemplate-depth-32 bindtest.cpp -o bindtest
/tmp/ccIdnnhy.o: In function
undefined reference to `runtime_error::runtime_error(basic_string<char,
string_char_traits<char>, __default_alloc_template<false, 0> > const &)'
collect2: ld returned 1 exit status
make: *** [bindtest] Error 1

After quite a lot of mucking about, I discovered that I had to define
CXX to 'QCC' and comment out the following line in

#ifndef __EXCEPTIONS

in order to compile successfully. So the appended test program
works, at least. However, the complete boost tarball seems to have some
problems. When I run bjam, the compiler keeps carping:

g++: unrecognized option '-pthread'

And there seem to be quite a few files with a basename longer than the
QNX max of 48 charactes.

I'm willing to help figure out how to get boost to compile better under
QNX if someone can give me a little guidance as to how to proceed. Part
of the problem may be that QNX 6.2.1 uses an STL implementation from
Dinkum instead of the one that comes with gcc 2.95.3. If someone'll
help direct my fingers where to go, I can probably sort some of this


- Dave

P.S. If it's helpful to anyone, I can post a QNX 6.2.1 binary of

% uname -a
QNX rtblnx1196 6.2.1 2003/01/18-02:12:22est x86pc x86

% gcc --version

// File: bindtest.cpp
// Compile: make bindtest CXX=QCC CPPFLAGS="-I. -ftemplate-depth-32"

#include <iostream>
#include <string>
#include <boost/bind.hpp>
#include <boost/ref.hpp>
#include <boost/function.hpp>

using namespace std;
typedef boost::function<void(void)> Callback;

struct Dummy
    void memberFunc( int num, const string& msg )
        cout << "memberFunc args: "
             << num
             << ", \"" << msg << "\""
             << endl;

main( void )
    Dummy mydummy;
    Callback c = boost::bind( &Dummy::memberFunc,
                              7, "is a lucky number..." );

    c( ); // prints: "memberFunc args: 7, "is a lucky number..."
    return 0;

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