我在Qt Creator的Necessitas版本中启动了一个Qt移动应用程序项目,专门针对API 15。从那里,我有一些我在Eclipse中编写的C ++源代码,我已将其添加到项目中。当然,有很多未定义的引用错误(由于Qt Necessitas的性质,默认情况下没有在OS的include / lib路径中查找),所以我做了一些谷歌搜索并找到了解决方法。
现在,在看起来工作之后,我似乎得到了一些奇怪的错误,这些错误与GNU的Android / ARM stlport有关。
也为此搜索,发现this。如果您阅读了上一篇文章,那么OP最后会很难过,并且很难找出问题所在。我的错误似乎有点不同,但仍然与他/她相同的盟友。
基本上,我真的可以使用一些指导来解决这个问题。如果有人有任何想法或遇到同样的问题,我真的很感激你的建议!
底部是cbin_base.h的pastebin。
谢谢!
问题
所以,因为我正在链接gnu-libstdc ++(.so
版本,AFAIK),我在ctype_base.h
收到了以下错误:
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:44: error: '_U' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:45: error: '_L' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:46: error: '_U' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:46: error: '_L' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:47: error: '_N' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:48: error: '_X' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:48: error: '_N' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:49: error: '_S' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:50: error: '_P' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:50: error: '_U' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:50: error: '_L' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:50: error: '_N' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:50: error: '_B' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:51: error: '_P' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:51: error: '_U' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:51: error: '_L' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:51: error: '_N' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:52: error: '_C' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:53: error: '_P' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:54: error: '_U' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:54: error: '_L' was not declared in this scope
/opt/android-ndk/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/bits/ctype_base.h:54: error: '_N' was not declared in this scope
因为Qt的Necessitas NDK似乎落后了几个版本,所以我决定只使用我收到的最新版本。当然,Necessitas还没有完全稳定(仍然在Alpha 3,IIRC),所以我不能指望太多,但是在Eclipse中有一些非常不必要的错误经验后,我真的很想不得不回到那里再次。不要误会我的意思,如果你正在进行Java开发,那肯定是要走的路。只是...不适用于C ++;)
以下是我的.pro
文件:
# Add files and directories to ship with the application
# by adapting the examples below.
# file1.source = myfile
# dir1.source = mydir
DEPLOYMENTFOLDERS = # file1 dir1
symbian:TARGET.UID3 = 0xED47BA19
# Smart Installer package's UID
# This UID is from the protected range
# and therefore the package will fail to install if self-signed
# By default qmake uses the unprotected range value if unprotected UID is defined for the application
# and 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
# If your application uses the Qt Mobility libraries, uncomment
# the following lines and add the respective components to the
# MOBILITY variable.
# CONFIG += mobility
# MOBILITY +=
SOURCES += main.cpp mainwindow.cpp \
GLTriangleDemo.cpp \
Debug.cpp \
Shader.cpp
HEADERS += mainwindow.h \
GLincludes.hpp \
GLDemo.hpp \
Entry.hpp \
Debug.hpp \
Triangle.hpp \
Shape.hpp \
Shader.hpp \
GLTriangleDemo.hpp
FORMS += mainwindow.ui
#includes
INCLUDEPATH += /usr/include
#external deps
external_libs.files += /usr/lib
x86 {
external_libs.path = /libs/x86
} else: armeabi-v7a {
external_libs.path = /libs/armeabi-v7a
} else {
external_libs.path = /libs/armeabi
}
INSTALLS += external_libs
LIBS += -llog -lGLESv2 -lgnustl_shared
# Please do not modify the following two lines. Required for deployment.
include(deployment.pri)
qtcAddDeployment()
OTHER_FILES += \
android/res/values-ja/strings.xml \
android/res/values-it/strings.xml \
android/res/values-pt-rBR/strings.xml \
android/res/values-el/strings.xml \
android/res/values-nl/strings.xml \
android/res/values-ro/strings.xml \
android/res/values-id/strings.xml \
android/res/values-fr/strings.xml \
android/res/values-rs/strings.xml \
android/res/values-de/strings.xml \
android/res/drawable-hdpi/icon.png \
android/res/values-pl/strings.xml \
android/res/values-ru/strings.xml \
android/res/values-es/strings.xml \
android/res/values-ms/strings.xml \
android/res/values/strings.xml \
android/res/values/libs.xml \
android/res/drawable/icon.png \
android/res/drawable/logo.png \
android/res/values-zh-rTW/strings.xml \
android/res/layout/splash.xml \
android/res/values-fa/strings.xml \
android/res/drawable-mdpi/icon.png \
android/res/drawable-ldpi/icon.png \
android/res/values-nb/strings.xml \
android/res/values-zh-rCN/strings.xml \
android/res/values-et/strings.xml \
android/version.xml \
android/AndroidManifest.xml \
android/src/org/kde/necessitas/origo/QtApplication.java \
android/src/org/kde/necessitas/origo/QtActivity.java \
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
android/src/org/kde/necessitas/ministro/IMinistro.aidl
而且,这是ctype_base.h的pastebin
答案 0 :(得分:1)
我遇到了同样的问题。在我看来,问题似乎是由环境变量引起的,即“CPLUS_INCLUDE_PATH”和“C_INCLUDE_PATH”。这些变量包含了我的系统C ++的路径,我想这些路径干扰了armabi平台包含的内容。
解决方案:我只是取消了这两个环境。变量
Redgis
PS:我修改了我以前的答案,但仍标记为“已删除”,所以我重新发布。不适合我这样做,但我没有看到另一种方式来发表我的贡献。