2008-10-27 11 views
5

के लिए सीओ ++ लाइब्रेरी को बढ़ावा दें मुझे 1.35.0 के साथ-साथ टाइमिस आर्म-जीसीसी टूलचेन पर 1.36.0 कोई समस्या नहीं है, दोनों स्थिर रूप से (लिंक-स्टेटिक) के साथ-साथ गतिशील रूप से (.so, डिफ़ॉल्ट विकल्प)।जीसीसी-आर्म टूलचेन

हालांकि

, जब मैं एक साधारण नमूना फाइल सिस्टम एप्लिकेशन को लिंक करने का प्रयास करें:

#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; 
} 

मैं निम्नलिखित लिंकर त्रुटि मिलती है:


[email protected]:~/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 

किसी को भी पता है कि कैसे मैं के लिए निर्माण करने के लिए बढ़ावा मिल सकता है जीसीसी-हाथ टूलचेन?

उत्तर

3

आप फ़ाइल में 'boost_1_35_0/बढ़ावा/config/user.hpp' जोड़ने की जरूरत:

#define BOOST_SP_USE_PTHREADS 

btw, तुम फ़ाइल में जीसीसी उपकरण श्रृंखला स्थापित करने की आवश्यकता 'boost_1_35_0/उपकरण/निर्माण/वी 2 /user-config.jam 'से:

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

इससे अब लिंक करने की समस्या हल हो जाएगी।

3

बूस्ट मेलिंग सूची पर लगभग एक समान प्रश्न का उत्तर here दिया गया था।

संबंधित मुद्दे