构建1.35.0以及在timesys arm-gcc工具链上的1.36.0,无论是静态(链接静态)还是动态(.so,默认选项)都没有问题.
但是,当我尝试链接一个简单的示例文件系统应用程序时:
#include#include 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; }
我收到以下链接器错误:
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
有谁知道如何让我的Boost为gcc-arm工具链构建?