我正在尝试为iOS编译OpenFST,这里是make失败的地方:
cd openfst-1.6.5/src/lib
/Applications/Xcode.app/Contents/Developer/usr/bin/g++
-DHAVE_CONFIG_H
-I./../include
-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/c++/4.2.1/
-I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/
-miphoneos-version-min=8.1
-arch armv7
-fno-exceptions
-funsigned-char
-pipe
-no-cpp-precomp
-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
-std=c++11
-MT compat.lo -MD -MP -MF .deps/compat.Tpo -c compat.cc -o compat.o
它抛出许多类似的错误,比如这些
/../iPhoneOS.sdk/usr/include/c++/4.2.1/cwchar:212:12:
error: cannot initialize return object of type
'wchar_t *' with an rvalue of type 'const wchar_t *'
{ return wcschr(const_cast<const wchar_t*>(__p), __c); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/../iPhoneOS.sdk/usr/include/c++/4.2.1/cwchar:218:12:
error: cannot initialize return object of type
'wchar_t *' with an rvalue of type 'const wchar_t *'
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/../usr/include/c++/v1/tuple:1352:22:
error: C++ requires a type specifier for all declarations
pair<_T1, _T2>::pair(piecewise_construct_t,
^
/../usr/include/c++/v1/tuple:1351:1:
error: declarator requires an identifier
inline _LIBCPP_INLINE_VISIBILITY
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
我觉得我在这里使用错误的c ++版本?
答案 0 :(得分:0)
如果你的追溯中的c++/4.2.1
意味着GCC 4.2.1,那么这是一个非常古老的编译器套件(11岁)。 OpenFst README表示它需要GCC 4.7或更高版本。 (这可能是对C ++ 11和C99的支持。)我不知道如何将XCode版本映射到Clang编译器版本(以及哪些Clang版本对C ++ 11有大量支持),但我想这是在某处记录的。 / p>
FWIW正如我们所说,我在Linux + armv7 + GCC 5.4.0(廉价Chromebook + Crouton)上运行OpenFst,所以我怀疑ARM是否支持。