Qt Creator の Necessitas バージョンで Qt モバイル アプリケーション プロジェクトを開始し、特に API 15 をターゲットにしました。そこから、Eclipse で作成したいくつかの C++ ソースをプロジェクトに追加しました。もちろん、多くの未定義の参照エラーがありました (Qt Necessitas の性質により、デフォルトで OS の include/lib パスが検索されないため)、Google でいくつかの修正を行いました。
今、それが機能しているように見えた後、Android/ARM用のGNUのstlportを扱う奇妙なエラーが発生したようです。
それについてもグーグルで検索し、これを見つけました。最後の投稿を読んだ場合、OP は最後にかなり困惑し、問題を理解するのに苦労しました。私のエラーは少し違うように見えますが、それでも比較的彼/彼女と同じ味方です.
基本的に、この問題を解決する方法については、いくつかのガイダンスを実際に使用できます。誰かがこれに関して何か考えがあるか、同じ問題に遭遇した場合は、アドバイスをいただければ幸いです!
一番下は ctype_base.h のペーストビンです。
ありがとうございました!
問題へ
そのため、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のペーストビンがあります