Boost logo

Boost :

From: Alexander Nasonov (alnsn-mycop_at_[hidden])
Date: 2003-09-25 11:41:22

Alexander Nasonov wrote:

> David Abrahams wrote:
>> In the meantime, have you checked whether implementations
>> actually support this? It would seem to incur a serious penalty for
>> inline functions at link time.
> g++ 3.3.1 under linux works fine only if only *.o files were linked. If
> *.a file is used, I don't see any objects from this file in the
> static_list. If the program is linked with *.so file I get SIGSERV.
> Similar results with Intel 6.0 under linux :(

Sorry, it was something wrong a build instruction. *.so seems fine with g++.

[root_at_sat-pc test_mtu]# make clean test_so
rm -f test_a test_o test_so *.o *.a *.so
g++ -I.. -I/usr/local/src/boost -c main.cpp -o main.o
g++ -I.. -I/usr/local/src/boost -c other.cpp -o other.o
g++ -L. other.o -shared -o
g++ -L. main.o -lother -o test_so

[root_at_sat-pc test_mtu]# ldd ./test_so => /home/alnsn/usr/lib/ (0x4002d000) => /usr/local/lib/ (0x40030000) => /lib/i686/ (0x400e9000) => /usr/local/lib/ (0x4010b000) => /lib/i686/ (0x42000000)
        /lib/ => /lib/ (0x40000000)

[root_at_sat-pc test_mtu]# file /home/alnsn/usr/lib/
/home/alnsn/usr/lib/ symbolic link to

[root_at_sat-pc test_mtu]# pwd

[root_at_sat-pc test_mtu]# ./test_so
size: 6 elements: 2 1 0 5 4 3

[root_at_sat-pc test_mtu]# cat main.cpp
#include "static_list.hpp"

#include <iostream>
#include <algorithm>
#include <boost/lambda/lambda.hpp>

// void activate_other();

boost::static_list<int>::insert element0(0);
boost::static_list<int>::insert element1(1);
boost::static_list<int>::insert element2(2);

int main()
// activate_other();
    boost::static_list<int> l;
    boost::lambda::placeholder1_type x;

    std::cout << "size: " << l.size() << " elements: ";

    std::for_each(l.begin(), l.end(), std::cout << x << ' ');

    std::cout << '\n';

[root_at_sat-pc test_mtu]# cat other.cpp
#include "static_list.hpp"

boost::static_list<int>::insert element3(3);
boost::static_list<int>::insert element4(4);
boost::static_list<int>::insert element5(5);

void activate_other()

Alexander Nasonov
Remove minus and all between minus and at from my e-mail for timely response

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