2012-05-01 94 views
0

我正在嘗試使用uclinux的交叉編譯器工具鏈編譯STLPort。 根據INSTALL在STLPort庫的根文件夾中,如果你想添加新的工具鏈,那麼你必須找到最近的工具鏈並修改你的編譯器。 我選擇gcc.mak並將gcc更改爲arm-linux-gcc和C++以arm-linux-C++。編譯時出現這個錯誤:使用arm-linux-gcc編譯STLPort時出現未知錯誤

.../../src/num_get_float.cpp:44:6: #error Unknown endianness. 
../../src/num_get_float.cpp: In function `double stlpmtx_std::_Stl_atod(char*, 
    int, int)': 
../../src/num_get_float.cpp:728: error: 'struct _ll::<anonymous>' has no member 
    named 'hi' 
../../src/num_get_float.cpp:729: error: 'struct _ll::<anonymous>' has no member 
    named 'lo' 
../../src/num_get_float.cpp:736: error: 'struct _ll::<anonymous>' has no member 
    named 'hi' 
../../src/num_get_float.cpp:737: error: 'struct _ll::<anonymous>' has no member 
    named 'lo' 

這個錯誤是什麼?我如何在arm-linux-gcc上爲STLPort創建一個合適的Makefile?

編輯:錯誤是由第一個答案固定的,但我有另一個錯誤: 當我嘗試編譯代碼,生成文件讓我這句話:
*注意! *
這個makefile試圖使用系統區域設置,這可能不適用於所有glibc風格。 如果構建失敗,請求助於gcc.mak將建立C-區域唯一版本的STLport 並最終我得到了這個錯誤的c_local.c:

In file included from c_locale.c:32: 
arm-linux-gcc -I../stlport -W -Wno-sign-compare -Wno-unused -Wno-uninitialized -D_STLP_USE_GLIBC -D_STLP_REAL_LOCALE_IMPLEMENTED -O2 -fpic c_locale.c -c -o ../lib/obj/GCC/ReleaseD/c_locale.o 
c_locale_glibc/c_locale_glibc.c: In function `_Find_locale': 
c_locale_glibc/c_locale_glibc.c:118: warning: return makes pointer from integer without a cast 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_decimal_point': 
c_locale_glibc/c_locale_glibc.c:242: error: `DECIMAL_POINT' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c:242: error: (Each undeclared identifier is reported only once 
c_locale_glibc/c_locale_glibc.c:242: error: for each function it appears in.) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_thousands_sep': 
c_locale_glibc/c_locale_glibc.c:246: error: `THOUSANDS_SEP' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_grouping': 
c_locale_glibc/c_locale_glibc.c:250: error: `GROUPING' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_int_curr_symbol': 
c_locale_glibc/c_locale_glibc.c:289: error: `INT_CURR_SYMBOL' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_currency_symbol': 
c_locale_glibc/c_locale_glibc.c:292: error: `CURRENCY_SYMBOL' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_mon_decimal_point': 
c_locale_glibc/c_locale_glibc.c:295: error: `MON_DECIMAL_POINT' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_mon_thousands_sep': 
c_locale_glibc/c_locale_glibc.c:298: error: `MON_THOUSANDS_SEP' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_mon_grouping': 
c_locale_glibc/c_locale_glibc.c:301: error: `MON_GROUPING' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_positive_sign': 
c_locale_glibc/c_locale_glibc.c:304: error: `POSITIVE_SIGN' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_negative_sign': 
c_locale_glibc/c_locale_glibc.c:307: error: `NEGATIVE_SIGN' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_int_frac_digits': 
c_locale_glibc/c_locale_glibc.c:310: error: `INT_FRAC_DIGITS' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_frac_digits': 
c_locale_glibc/c_locale_glibc.c:313: error: `FRAC_DIGITS' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_p_cs_precedes': 
c_locale_glibc/c_locale_glibc.c:316: error: `P_CS_PRECEDES' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_p_sep_by_space': 
c_locale_glibc/c_locale_glibc.c:319: error: `P_SEP_BY_SPACE' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_p_sign_posn': 
c_locale_glibc/c_locale_glibc.c:322: error: `P_SIGN_POSN' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_n_cs_precedes': 
c_locale_glibc/c_locale_glibc.c:325: error: `N_CS_PRECEDES' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_n_sep_by_space': 
c_locale_glibc/c_locale_glibc.c:328: error: `N_SEP_BY_SPACE' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_n_sign_posn': 
c_locale_glibc/c_locale_glibc.c:331: error: `N_SIGN_POSN' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `_Locale_ctype_create': 
c_locale_glibc/c_locale_glibc.c:485: error: `_NL_CTYPE_TOLOWER_EL' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c:487: error: `_NL_CTYPE_TOUPPER_EL' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c: In function `cname_lookup': 
c_locale_glibc/c_locale_glibc.c:526: error: `_NL_CTYPE_NAMES_EL' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c:531: error: `_NL_CTYPE_HASH_SIZE' undeclared (first use in this function) 
c_locale_glibc/c_locale_glibc.c:532: error: `_NL_CTYPE_HASH_LAYERS' undeclared (first use in this function) 
make: *** [../lib/obj/GCC/ReleaseD/c_locale.o] Error 1 

我覺得這個錯誤與makefile的注意。 我能解決什麼問題?什麼是參考gcc.mak

回答

1

檢查要運行uclinux的ARM處理器的字節序性。然後,您可以嘗試在Makefile中運行gcc -D_STLP_BIG_ENDIAN ...gcc -D_STLP_LITTLE_ENDIAN ...以獲取此錯誤。