Issue
We do get error: unknown type name 'wchar_t'
,
while trying to compile Network.c
to Network.o
(for our android library network.so
) with below command-line in our Makefile
file.
command-line options:
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
Solution
While in C++ wchar_t
is a built-in type (and in MSVC we enable it with /Zc:wchar_t
command-line), in the good old C
we still need to ensure to include its header like:
#include <wchar.h>
While we was expecting
Android
to have some kind of global macro that needs to be defined in command-line to enablewchar_t
(like MSVC).
Answered By - Top-Master
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.