gpt4 book ai didi

Android NDK - 未知类型名称 'wchar_t'(在 API 21 上)

转载 作者:太空狗 更新时间:2023-10-29 15:37:22 29 4
gpt4 key购买 nike

我们确实得到错误:未知类型名称'wchar_t'
在我们的 中尝试使用以下命令行将 Network.c 编译为 Network.o(对于我们的 android 库 network.so) >Makefile 文件。

命令行选项:

D:\android\sdk\ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows/bin/arm-linux-androideabi-gcc
-c
-pipe
-ID:/android/sdk/ndk-bundle/sysroot/usr/include
-ID:/android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-ID:/android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.9.x/include
-Wno-attributes
-Wno-unused-label
-Wno-unused-parameter
-Wno-unused-variable
-Wno-unused-but-set-variable
-Wno-unused-value
-Wno-unused-function
-Wno-write-strings
-Wno-sign-compare
-Wno-type-limits
-Wno-missing-field-initializers
-Wno-cast-qual
-fstack-protector-strong
-DANDROID
-march=armv7-a
-mfloat-abi=softfp
-mfpu=vfp
-fno-builtin-memmove
--sysroot=D:\android\sdk\ndk-bundle/platforms/android-21/arch-arm/
-IC:/compiler/qt_android_armv7/mkspecs/features/../../src/extras/include
-ID:/android/sdk/ndk-bundle/sysroot/usr/include
-ID:/android/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi
-ID:/android/sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/windows/lib/gcc/arm-linux-androideabi/4.9.x/include
-g
-marm
-O0
-Wall
-W
-D_REENTRANT
-fPIC
-D__ANDROID_API__=21
-DANDROID_VPN
-DANDROID_VPN_UNICODE
-DSOFTETHER_NO_CHANGE
-DCEDAR_CLIENT_STR=\"LimeyGate.Client\"
-D_DEBUG
-DDEBUG
-DUNIX
-DUNIX_LINUX
-D_REENTRANT
-DREENTRANT
-D_THREAD_SAFE
-D_THREADSAFE
-DTHREAD_SAFE
-DTHREADSAFE
-D_FILE_OFFSET_BITS=64
-DQT_QML_DEBUG
-DQT_GUI_LIB
-DQT_CORE_LIB
-I..\..\projects\VpnProject\client-android\backend
-I.
-I..\..\projects\VpnProject\client-android\backend\include
-I..\..\projects\VpnProject\3rdParty
-IC:\compiler\qt_android_armv7\src\extras\lib\crypt\openssl-1.0.1c\include
-I..\..\projects\VpnProject\SoftEtherVPN\src
-I..\..\projects\VpnProject\SoftEtherVPN\src\Cedar
-IC:\compiler\qt_android_armv7\include
-IC:\compiler\qt_android_armv7\include\QtGui
-IC:\compiler\qt_android_armv7\include\QtCore
-I.
-ID:\android\sdk\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\include
-ID:\android\sdk\ndk-bundle\sources\cxx-stl\gnu-libstdc++\4.9\libs\armeabi-v7a\include
-ID:\android\sdk\ndk-bundle\sysroot\usr\include
-IC:\compiler\qt_android_armv7\mkspecs\android-g++
-o
Network.obj
..\..\projects\VpnProject\SoftEtherVPN\src\Mayaqua\Network.c

最佳答案

虽然在 C++ 中 wchar_t 是内置类型(在 MSVC 中我们使用 /Zc:wchar_t 命令行启用它),但在旧的 C 我们仍然需要确保包含它的 header ,例如:

#include <wchar.h>

But we were expecting Android to have some kind of global macro that needs to be defined in command-line to enable wchar_t (because our previous MSVC experience).

关于Android NDK - 未知类型名称 'wchar_t'(在 API 21 上),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54085845/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com