Arduino: 1.6.9 (Windows 10), Board: "Arduino Mega ADK"
In file included from C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino:1:0:
C:\Users\Disheet\Documents\Arduino\libraries\ax12v2/ax12.h:66:23: error: conflicting declaration 'typedef unsigned char boolean'
typedef unsigned char boolean;
^
In file included from sketch\humanoid_1.ino.cpp:1:0:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:117:14: error: 'boolean' has a previous declaration as 'typedef bool boolean'
typedef bool boolean;
^
C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino: In function 'void setup()':
humanoid_1:5: error: 'SetPosition' was not declared in this scope
SetPosition(1,0);////id,posiotin 0-1023
^
C:\Users\Disheet\Downloads\humanoid_1\humanoid_1.ino: In function 'void loop()':
humanoid_1:13: error: 'SetPosition' was not declared in this scope
SetPosition(1,512);
^
Multiple libraries were found for "ax12.h"
Used: C:\Users\Disheet\Documents\Arduino\libraries\ax12v2
Not used: C:\Users\Disheet\Documents\Arduino\libraries\Bioloid
exit status 1
'SetPosition' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
You'll need to find typedef unsigned char boolean; in your library and change it to match the version in Arduino.h.
boolean is already a typedef in Arduino.h, and it is a bool ,not unsigned char.
In the AX12 library search for this:
https://github.com/7Robot/Arduino/blob/master/AX12/libraries/ax12/ax12.h#L66
And change it to typedef bool boolean;.
This was updated a while ago, so your IDE version is newer than the AX12 library.
Related
I am tring to build an R package with Rcpp using Rstudio. When I click "install and restart", Rstudio outputs hundreds of warning information and I cannot easily find the error information. I tried to find out reason to avoid the warning information but failed. It seems the warnings are from Rcpp package. BTW, the package can still work.
The below is the additional options for R CMD INSTALL
--no-multiarch --with-keep.source
The information can be replicated using the below commands
library(devtools) # author version: 2.3.0, use install.packages("devtools") first
install_github("GeneticAnalysisinBiobanks/GRAB", INSTALL_opts=c("--no-multiarch")) # The INSTALL_opts is required in Windows OS.
My working environment:
> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936 LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936 LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] devtools_2.4.2 usethis_2.0.1
loaded via a namespace (and not attached):
[1] rstudioapi_0.13 magrittr_2.0.1 pkgload_1.2.1 R6_2.5.0
[5] rlang_0.4.11 fastmap_1.1.0 tools_4.1.0 pkgbuild_1.2.0
[9] sessioninfo_1.1.1 cli_3.0.0 withr_2.4.2 ellipsis_0.3.2
[13] remotes_2.4.0 rprojroot_2.0.2 lifecycle_1.0.0 crayon_1.4.1
[17] processx_3.5.2 purrr_0.3.4 callr_3.7.0 fs_1.5.0
[21] ps_1.6.0 curl_4.3.1 testthat_3.0.4 memoise_2.0.0
[25] glue_1.4.2 cachem_1.0.5 compiler_4.1.0 desc_1.3.0
[29] prettyunits_1.1.1
The below include the warning information when I install and restart the package.
In file included from C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/RcppCommon.h:118,
from C:/Users/wenjianb/Documents/R/win-library/4.1/RcppArmadillo/include/RcppArmadilloForward.h:26,
from C:/Users/wenjianb/Documents/R/win-library/4.1/RcppArmadillo/include/RcppArmadillo.h:31,
from RcppExports.cpp:4:
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'const char* Rcpp::type2name(SEXP)':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'const char* (*)(SEXPREC*)'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:74:26: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("type2name");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::enterRNGScope()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:81:30: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("enterRNGScope");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::exitRNGScope()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:87:30: note: in expansion of macro 'GET_CALLABLE'
static Fun fun = GET_CALLABLE("exitRNGScope");
^~~~~~~~~~~~
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h: In function 'long unsigned int Rcpp::internal::beginSuspendRNGSynchronization()':
C:/Users/wenjianb/Documents/R/win-library/4.1/Rcpp/include/Rcpp/routines.h:70:73: warning: cast between incompatible function types from 'DL_FUNC' {aka 'void* (*)()'} to 'Fun' {aka 'long unsigned int (*)()'} [-Wcast-function-type]
#define GET_CALLABLE(__FUN__) (Fun) R_GetCCallable( "Rcpp", __FUN__ )
^
The other warnings are all similar to the above.
Thank you all in advance.
Wenjian
I am writing a C code which I wish to run in android using ndk. I have glibc library in the code which as I understood is difficult to port directly. Hence I tried to use libc instead from the bionic repository in github. I am facing numerous errors while building it.
Could anyone explain how to include libc in a step by step procedure(or guide me to some source). I have searched a lot and was unable to find a tutorial anywhere.
These are the errors I get:
In file included from jni/libc/private/ScopedPthreadMutexLocker.h:22:0,
from jni/libc/bionic/malloc_debug_common.cpp:47:
jni/libc/private/bionic_macros.h:27:31: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 [enabled by default]
TypeName(const TypeName&) = delete; \
^
jni/libc/private/ScopedPthreadMutexLocker.h:37:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
DISALLOW_COPY_AND_ASSIGN(ScopedPthreadMutexLocker);
^
jni/libc/private/bionic_macros.h:28:37: warning: defaulted and deleted functions only available with -std=c++11 or -std=gnu++11 [enabled by default]
void operator=(const TypeName&) = delete
^
jni/libc/private/ScopedPthreadMutexLocker.h:37:3: note: in expansion of macro 'DISALLOW_COPY_AND_ASSIGN'
DISALLOW_COPY_AND_ASSIGN(ScopedPthreadMutexLocker);
^
In file included from jni/libc/bionic/jemalloc.h:20:0,
from jni/libc/bionic/malloc_debug_common.cpp:50:
jni/libc/jemalloc/jemalloc.h:108:36: error: declaration of C function 'size_t malloc_usable_size(void*)' conflicts with
# define JEMALLOC_CXX_THROW throw()
^
jni/libc/jemalloc/jemalloc.h:231:43: note: in expansion of macro 'JEMALLOC_CXX_THROW'
JEMALLOC_USABLE_SIZE_CONST void *ptr) JEMALLOC_CXX_THROW;
^
In file included from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/string.h:33:0,
from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/signal.h:35,
from /home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/pthread.h:33,
from jni/libc/bionic/malloc_debug_common.h:36,
from jni/libc/bionic/malloc_debug_common.cpp:40:
/home/yogi/android-ndk/platforms/android-21/arch-arm/usr/include/malloc.h:36:15: error: previous declaration 'size_t malloc_usable_size(const void*)' here
extern size_t malloc_usable_size(const void* p);
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_calloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:67:3: note: in expansion of macro 'Malloc'
Malloc(calloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_free' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:68:3: note: in expansion of macro 'Malloc'
Malloc(free),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_malloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:70:3: note: in expansion of macro 'Malloc'
Malloc(malloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_malloc_usable_size' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:71:3: note: in expansion of macro 'Malloc'
Malloc(malloc_usable_size),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_posix_memalign' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:73:3: note: in expansion of macro 'Malloc'
Malloc(posix_memalign),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_realloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:77:3: note: in expansion of macro 'Malloc'
Malloc(realloc),
^
jni/libc/bionic/malloc_debug_common.cpp:51:27: error: 'je_valloc' was not declared in this scope
#define Malloc(function) je_ ## function
^
jni/libc/bionic/malloc_debug_common.cpp:79:3: note: in expansion of macro 'Malloc'
Malloc(valloc),
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'void get_malloc_leak_info(uint8_t**, size_t*, size_t*, size_t*, size_t*)':
jni/libc/bionic/malloc_debug_common.cpp:191:96: error: 'je_malloc' was not declared in this scope
HashEntry** list = static_cast<HashEntry**>(Malloc(malloc)(sizeof(void*) * g_hash_table.count));
^
jni/libc/bionic/malloc_debug_common.cpp:214:22: error: 'je_free' was not declared in this scope
Malloc(free)(list);
^
jni/libc/bionic/malloc_debug_common.cpp:236:20: error: 'je_free' was not declared in this scope
Malloc(free)(list);
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'void free_malloc_leak_info(uint8_t*)':
jni/libc/bionic/malloc_debug_common.cpp:240:20: error: 'je_free' was not declared in this scope
Malloc(free)(info);
^
jni/libc/bionic/malloc_debug_common.cpp: In function 'size_t malloc_usable_size(const void*)':
jni/libc/bionic/malloc_debug_common.cpp:262:53: error: declaration of C function 'size_t malloc_usable_size(const void*)' conflicts with
extern "C" size_t malloc_usable_size(const void* mem) {
^
In file included from jni/libc/bionic/jemalloc.h:20:0,
from jni/libc/bionic/malloc_debug_common.cpp:50:
jni/libc/jemalloc/jemalloc.h:70:33: error: previous declaration 'size_t malloc_usable_size(void*)' here
# define je_malloc_usable_size malloc_usable_size
^
jni/libc/jemalloc/jemalloc.h:230:41: note: in expansion of macro 'je_malloc_usable_size'
JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size(
^
make: *** [obj/local/armeabi-v7a/objs/c/bionic/malloc_debug_common.o] Error 1
How to fix it?
Thanks!
I tried to use libc instead from the bionic repository in github.
It appears that you've copied Bionic libc into your project, and are trying to build it.
Don't. A prebuilt copy is already provided to you as part of the ndk, and you don't need to do anything special to use it: the ndk-provided compiler will do that automatically.
You should concentrate on building your application, not copying random libc variants and trying to build them.
I'm trying to install reactive-banana, wx, wxcore in cabal sandbox. When cabal install --only-dependencies is run following error message is given:
src\cpp\eljlistctrl.cpp: In function 'int ListCmp(long int, long int, long int)':
src\cpp\eljlistctrl.cpp:16:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
src\cpp\eljlistctrl.cpp:16:53: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
src\cpp\eljlistctrl.cpp: In function 'bool wxListCtrl_SortItems(wxListCtrl*, void*, void*)':
src\cpp\eljlistctrl.cpp:478:41: error: cast from 'EiffelSort* {aka _EiffelSort*}' to 'long int' loses precision [-fpermissive]
src\cpp\eljlistctrl.cpp:478:44: error: invalid conversion from 'int (*)(long int, long int, long int)' to 'wxListCtrlCompare {aka int (*)(long long int, long long int, long long int)}' [-fpermissive]
C:\wxWidgets-3.0.2\include/wx/msw/listctrl.h:342:10: error: initializing argument 1 of 'bool wxListCtrl::SortItems(wxListCtrlCompare, wxIntPtr)' [-fpermissive]
What is wrong and how to solve this?
The code in this file just seems to be wrong and uses 32 bit types even in what looks like 64 bit build. Unless it was fixed in later versions, the only solution would be to build it in 32 bits, i.e. use a 32 bit Haskell installation.
I have a 3rd party C++ .lib that I would like to use in a C# application.
My intent is to write a managed C++ wrapper .dll for the .lib, and then include that wrapper dll in my C# application, using a process roughly like the one outlined at this link.
The header file for the .lib does not indicate any class declaration or namespace, just method names:
int CheckNamedVariable(const char* _name);
int RegisterNamedVariable(const char* _name);
double GetNamedVariableValue(int _id);
double GetNamedVariableTypedValue(int _id, int _units);
void SetNamedVariableValue(int _id, double _value);
... (etc)
I checked the lib with DUMPBIN /exports to see if I could glean any additional information, and got the following:
File Type: LIBRARY
Exports
ordinal name
?AircraftVarGet##YANHHH#Z (double __cdecl AircraftVarGet(int,int,int))
?CheckNamedVariable##YAHPBD#Z (int __cdecl CheckNamedVariable(char const *))
?DLLStart##YGXXZ (void __stdcall DLLStart(void))
?DLLStop##YGXXZ (void __stdcall DLLStop(void))
?GetAircraftVarEnum##YAHPBD#Z (int __cdecl GetAircraftVarEnum(char const *))
?GetModuleVar##YANW4GAUGE_TOKEN###Z (double __cdecl GetModuleVar(enum GAUGE_TOKEN))
?GetNameOfNamedVariable##YAPBDH#Z (char const * __cdecl GetNameOfNamedVariable(int))
?GetNamedVariableTypedValue##YANHH#Z (double __cdecl GetNamedVariableTypedValue(int,int))
?GetNamedVariableValue##YANH#Z (double __cdecl GetNamedVariableValue(int))
?GetUnitsEnum##YAHPBD#Z (int __cdecl GetUnitsEnum(char const *))
?IsPanelWindowVisibleIdent##YAHI#Z (int __cdecl IsPanelWindowVisibleIdent(unsigned int))
?Panels##3PAUPANELS##A (struct PANELS * Panels)
?RegisterNamedVariable##YAHPBD#Z (int __cdecl RegisterNamedVariable(char const *))
?SendKeyEvent##YAXII#Z (void __cdecl SendKeyEvent(unsigned int,unsigned int))
?SetNamedVariableTypedValue##YAXHNH#Z (void __cdecl SetNamedVariableTypedValue(int,double,int))
?SetNamedVariableValue##YAXHN#Z (void __cdecl SetNamedVariableValue(int,double))
_ImportTable
_Linkage
Summary
ED .debug$S
14 .idata$2
14 .idata$3
4 .idata$4
4 .idata$5
1A .idata$6
In my managed wrapper project, I can point the Linker input to the .lib, but I'm not sure how to call the methods in the lib (the tutorial I linked to makes use of namespaces and classes). If it were a plain old DLL in a C#/VB project, I could view the object browser and get some idea of how to call the library.
But given my C++ ignorance, I'm in the dark. Any help appreciated.
EDIT:
I tried just creating methods with the same name as the methods listed in the header, e.g.:
int VariableExporter::IsPanelWindowVisibleIdent(unsigned int panel_id)
{
return IsPanelWindowVisibleIdent(panel_id);
}
This is not doing what I'd hope, it's just recursively calling itself (until it has a - wait for it - Stack Overflow).
Then I tried renaming the wrapper method like this:
int VariableExporter::IsPanelWindowVisibleIdent_New_Name(unsigned int panel_id)
{
return IsPanelWindowVisibleIdent(panel_id);
}
Now, although the C++ .DLL project and the C# project both compile, the C# project throws a FileNotFound exception when it tries to load that .DLL.
First thing, to call global level function, you need to use the scope resolution operator ::
int VariableExporter::IsPanelWindowVisibleIdent(unsigned int panel_id)
{
return ::IsPanelWindowVisibleIdent(panel_id);
}
There is no need (at least for this simple case), to rename your method.
Secondly, for DLL-not-found issue, check that DLL is present in the bin path of your C# application. Also, check that wrapper-DLL itself is loadable (use Dependency Walker). Ensure that bit-ness of wrapper DLL and C# application also matches. A 64-bit application cannot load 32-bit DLL (and vice versa).
I am trying to create a JNI wrapper for a C library that depends on the ICU libraries (libicuuc.so and libicui18n.so).
I tried building ICU4C in my NDK (both standard and CrystaX versions, on a Mac OS X machine) and kept running into linking issues like this:
/Users/kyip/KyVmShared/KyAndroid/myproject/obj/local/armeabi/objs/icuuc/udata.o: In function `openCommonData':
/Users/kyip/KyVmShared/KyAndroid/myproject/jni/icu4c/common/udata.c:836: undefined reference to `icudt42_dat'
/Users/kyip/KyVmShared/KyAndroid/myproject/obj/local/armeabi/objs/icuuc/ustr_wcs.o: In function `_strFromWCS':
/Users/kyip/KyVmShared/KyAndroid/myproject/jni/icu4c/common/ustr_wcs.c:365: undefined reference to `wcstombs'
/Users/kyip/KyVmShared/KyAndroid/myproject/jni/icu4c/common/ustr_wcs.c:415: undefined reference to `wcstombs'
/Users/kyip/KyVmShared/KyAndroid/myproject/jni/icu4c/common/ustr_wcs.c:314: undefined reference to `wcstombs'
/Users/kyip/KyVmShared/KyAndroid/myproject/obj/local/armeabi/objs/icuuc/ustr_wcs.o: In function `_strToWCS':
/Users/kyip/KyVmShared/KyAndroid/myproject/jni/icu4c/common/ustr_wcs.c:164: undefined reference to `mbstowcs'
collect2: ld returned 1 exit status
I also tried the suggestion given at unicode support in android ndk but no luck. I got stuck at:
arm-eabi-g++ -I/ky/crystax/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib -fPIC -DU_COMMON_IMPLEMENTATION -D_REENTRANT -I../common -I../../icu/source/common -I../../icu/source/i18n "-DDEFAULT_ICU_PLUGINS=\"/usr/local/lib/icu\" " -DU_COMMON_IMPLEMENTATION -DHAVE_CONFIG_H -I/ky/crystax/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/ -O3 -fno-short-wchar -DU_USING_ICU_NAMESPACE=0 -DU_GNUC_UTF16_STRING=0 -fno-short-enums -nostdlib -fPIC -DU_COMMON_IMPLEMENTATION -std=c++0x -fvisibility=hidden -c -o errorcode.ao ../../icu/source/common/errorcode.cpp
In file included from ../../icu/source/common/unicode/ptypes.h:23,
from ../../icu/source/common/unicode/umachine.h:52,
from ../../icu/source/common/unicode/utypes.h:36,
from ../../icu/source/common/errorcode.cpp:17:
/ky/crystax/android-ndk-r4-crystax/build/platforms/android-8/arch-arm/usr/include/sys/types.h:122: error: 'uint64_t' does not name a type
make[1]: *** [errorcode.ao] Error 1
make: *** [all-recursive] Error 2
Any help would be appreciated.
It seems that two files are involved in this issue. icu/source/common/unicode/ptypes.h which calls sys/types.h includes
#if ! U_HAVE_UINT64_T
typedef unsigned long long uint64_t;
/* else we may not have a 64-bit type */
#endif
By including sys/types.h from Android, we involve (near line 122/124)
#ifdef __BSD_VISIBLE
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef uint32_t u_int32_t;
typedef uint16_t u_int16_t;
typedef uint8_t u_int8_t;
typedef uint64_t u_int64_t;
#endif
It seems that uint64_t has not been declared when it is assigned to u_int64_t. Indeed, sys/types.h includes stdint.h which has the following:
#if !defined __STRICT_ANSI__ || __STDC_VERSION__ >= 199901L
# define __STDC_INT64__
#endif
typedef __int8_t int8_t;
typedef __uint8_t uint8_t;
typedef __int16_t int16_t;
typedef __uint16_t uint16_t;
typedef __int32_t int32_t;
typedef __uint32_t uint32_t;
#if defined(__STDC_INT64__)
typedef __int64_t int64_t;
typedef __uint64_t uint64_t;
#endif
Likely STRICT_ANSI is not defined. Seems like this is a bug in the Android code in sys/types.h. If STDC_INT64 is not defined, it will not define uint64_t so it can't define u_int64_t. Perhaps the real solution is to have sys/types.h modified so that it has
#ifdef __BSD_VISIBLE
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
typedef uint32_t u_int32_t;
typedef uint16_t u_int16_t;
typedef uint8_t u_int8_t;
$if defined(__STDC_INT64__)
typedef uint64_t u_int64_t;
#endif
#endif
If you fix this, the next error will be in cstring.h:109
icu/source/common/cstring.h:109: error: 'int64_t' has not been declared
If you instead #define STDC_INT64 in common/unicode/ptypes.h it will go substantially farther, but will end at
icu/source/common/ustrenum.cpp:118: error: must #include <typeinfo> before using typeid
with more info here: http://groups.google.com/group/android-ndk/browse_thread/thread/2ec9dc289d815ba3?pli=1 but no real solutions
I also had this issue:
undefined reference to `mbstowcs'
You should build and link with higher version of android api.
Note:
I tried to link it with libraries from android-ndk/platforms/android-4... I had thought that 4 is version of Android, but 4 is version of Android API. And Android API 4 corresponds to Android 1.6 witch is very very old there is really no mbstowcs function in libc
Here is how i solved the problem. It is dirty but it works. The lib got compiled:
1. file: /icu4c/common/cwchar.h
comment out the #if U_HAVE_WCHAR_H and the respective #endif so the <wchar.h> is always included.
replace the previous uprv_wcstombs definition with:
#define uprv_wcstombs(mbstr, wcstr, count) U_STANDARD_CPP_NAMESPACE wcs2mbs(mbstr, wcstr, count)
replace the previous uprv_mbstowcs definition with:
#define uprv_mbstowcs(wcstr, mbstr, count) U_STANDARD_CPP_NAMESPACE mbs2wcs(wcstr, mbstr, count)
2. file: /icu4c/common/ustr_wcs.cpp
somewhere at the top, under the already existing includes add the line:
#include "../wcsmbs.h"
3. create new file "icu4c/wcsmbs.h"
size_t mbs2wcs(wchar_t * __ restrict pwcs, const char * __ restrict s, size_t n)
{
mbstate_t mbs;
const char *sp;
memset(&mbs, 0, sizeof(mbs));
sp=s;
return (mbsrtowcs(pwcs,&sp,n,&mbs));
}
size_t wcs2mbs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n)
{
mbstate_t mbs;
const wchar_t *pwcsp;
memset(&mbs,0,sizeof(mbs));
pwcsp = pwcs;
return (wcsrtombs(s,&pwcsp,n,&mbs));
}
Hope it helps.
There has been an effort to provide NDK wrappers for the ICU libraries that are part of the system: https://android-review.googlesource.com/c/153001/.