Boost C ++ libraries for gcc-arm toolchain

I have no problems building 1.35.0, as well as 1.36.0 on the timesys arm-gcc toolchain, both statically (link-static) and dynamically (.so, default).

However, when I try to link the application with a simple sample file system:

#include <boost/filesystem.hpp>
#include <iostream>

namespace fs = boost::filesystem;

int main(int argc, char *argv[]) {
    const char* fileName = argv[1];
    std::cout << "file: " << fileName << " => " << fs::exists(fileName) << std::endl;
    return 0;
}

I get the following linker error:


developer@eldp01:~/boost/test$ /opt/timesys/at91sam9263_ek/toolchain/bin/armv5l-timesys-linux-gnueabi-gcc 
  exists.cpp -o exists.exe -I ../boost_1_35_0/ -lboost_filesystem -lboost_system -lstdc++ -L .

/tmp/ccex3NGb.o: In function `boost::detail::atomic_decrement(int*)':
exists.cpp:(.text._ZN5boost6detail16atomic_decrementEPi[boost::detail::atomic_decrement(int*)]+0x1c): 
  undefined reference to `__sync_fetch_and_add_4'

/tmp/ccex3NGb.o: In function `boost::detail::atomic_increment(int*)':
exists.cpp:(.text._ZN5boost6detail16atomic_incrementEPi[boost::detail::atomic_increment(int*)]+0x1c): 
  undefined reference to `__sync_fetch_and_add_4'

collect2: ld returned 1 exit status

Does anyone know how I can get Boost to create a gcc-arm binding?

+5
source share
2 answers

You need to add the file 'boost_1_35_0 / boost / config / user.hpp':

#define BOOST_SP_USE_PTHREADS

btw, you need to install the gcc toolchain in the file 'boost_1_35_0 / tools / build / v2 / user-config.jam' to:

using gcc
        : arm
        : /opt/timesys/at91sam9263_ek/toolchain/bin/armv5l-timesys-linux-gnueabi-gcc
;

This will solve the communication problem now.

+3

Boost.

+3

All Articles