Can't Cross Compile GDBServer for MIPS n32 - linux

I'm having trouble cross compiling GDBServer for MIPS n32. I'm using GCC-4.7.2, binutils-2.22, glibc-2.11.1, glibc-ports-2.11, and linux-2.6.32.61. My host is x86_64-cross-linux-gnu. My target is mips64-elf-linux. The specific ABI for MIPS is n32.
When I go to make GDBserver, I get an error while compiling regcache.c. regcache.c is in the gdb/gdbserver/. There is a struct called 'reg' that gcc is trying to compile. I have included all of the mips include files. I can compile GDBServer for x86 however. I greped all of the include files in /usr/include/ to try to find "struct reg" and was unsuccessful on finding anything. I found this article and I changed the names hoping that it would correct the issue but that won't work because the reg struct in regcache.c has attributes like offset and value. I have also tried messing with pt_regs in ptrace.h. However I don't think I should have to mess with the files that come with GDBServer.
My configure command is:
CC=mips64-elf-linux-gcc configure --host=x86_64-cross-linux-gnu --target=mips64-elf-linux
Does anyone know why I can't comiple GDBServer for Mips n32?
Thanks,
UPDATE:
../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:207:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:208:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find+_register_by_name'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:295:7: error: dereferencing pointer to incomplete type
../gdb-7.6/gdb/gdbserver/regcache.c: In function 'find_regno'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: invalid use of undefined type 'struct reg'
../gdb-7.6/gdb/gdbserver/regcache.c:315:7: error: dereferencing pointer to incomplete type

Related

How to compile Xeon phi patched gcc from source?

I downloaded the MPSS software stack version 3.5.2 source code from the intel website. I am trying to compile the xeon phi ported GCC (ported from GCC 4.7.0) from source and install it in a local subdirectory. However, I am getting the following error-
k1om-mpss-linux-gcc -dumpspecs > tmp-specs
/bin/sh: k1om-mpss-linux-gcc: command not found
My configuration is as follows-
# The below directory contains the cross compiled libs
# like assembler and linker
export PATH=$HOME/xeon-phi-gcc/bin
# The configure command
../xeon-phi-gcc/configure \
--build=x86_64-linux \
--host=x86_64-mpsssdk-linux \
--target=k1om-mpss-linux \
--prefix=$HOME/cross-gcc \
--enable-languages=c,c++ \
--with-sysroot=/opt/mpss/3.5.1/sysroots/k1om-mpss-linux \
--disable-multilib
# Compiling
make
Why is the Makefile calling k1om-mpss-linux-gcc ? Shouldn't this be the cross compiled gcc binary after make completes ? How can I fix this or what am I missing ?
EDIT 1: I changed the config parameters to --build=x86_64-mpsssdk-linux --host=x86_64-mpsssdk-linux. I get the following errors now-
In file included from gtype-desc.c:30:0:
../../gcc-4.7.0+mpss3.5.2/gcc/tree.h:3179:11: warning: identifier ‘thread_local’ conflicts with C++ keyword [-Wc++-compat]
unsigned thread_local : 1;
^
gtype-desc.c:8696:18: error: subscripted value is neither array nor pointer nor vector
sizeof (x_rtl[0]),
^
gtype-desc.c:8815:36: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_libfuncs[0]),
^
gtype-desc.c:8899:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8920:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8927:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8934:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c is a machine generated file.
EDIT 2: I am now getting the error-
/tmp/cc4aDvmI.s: Assembler messages:
/tmp/cc4aDvmI.s:94: Error: no such instruction: `kmov %esi,%k2'
/tmp/cc4aDvmI.s:147: Error: no such instruction: `kmov %edi,%k2'
/tmp/cc4aDvmI.s:255: Error: no such instruction: `kmov %r8d,%k2'
/tmp/cc4aDvmI.s:258: Error: no such instruction: `vpackstorelq %zmm0,(%rsp){%k2}'
How can I fix this ? These seem to be vector instructions but I thought that the gcc cross compiler didn't support vector instructions.
Your --build, --host and --target machine are all different (this is referenced as canadian compile, which is slightly different from cross compile, where --build and --host are the same). This means that an additional compiler is needed to build target libraries.
From GCC docs (6.1):
If build and host are different, you must have already built and installed a cross compiler that will be used to build the target libraries (if you configured with --target=foo-bar, this compiler will be called foo-bar-gcc).
So, as your --target is k1om-mpss-linux, you need that version of compiler in order to build GCC.
The result will be a GCC compiled on a --build machine that will run on a --host machine and that will produce code that can run on a --target machine.

How to fix 802.11 Linux STA broadcom driver not building on CENTOS?

I have got CENTOS 6.3 installed. My machine is Dell Studio. I have the following wireless broadcom model.
[root#treasure hybrid_wl]# lspci | grep -i wireless
03:00.0 Network controller: Broadcom Corporation BCM4313 802.11b/g/n Wireless LAN Controller (rev 01)
I got the source code of this driver from http://www.broadcom.com/support/802.11/linux_sta.php.
My machine kernel is
[root#treasure hybrid_wl]# uname -r
2.6.32-358.18.1.el6.x86_64
While building the package from http://www.broadcom.com/support/802.11/linux_sta.php.
I get the following error.
KBUILD_NOPEDANTIC=1 make -C /lib/modules/`uname -r`/build M=`pwd`
make[1]: Entering directory `/usr/src/kernels/2.6.32-358.18.1.el6.x86_64'
CFG80211 API is prefered for this kernel version
Using CFG80211 API
CC [M] /home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.o
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:79: warning: ‘enum tx_power_setting’ declared inside parameter list
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:79: warning: its scope is only this definition or declaration, which is probably not what you want
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1092: warning: ‘enum tx_power_setting’ declared inside parameter list
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1092: error: parameter 2 (‘type’) has incomplete type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_cfg80211_set_tx_power’:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1103: error: ‘TX_POWER_AUTOMATIC’ undeclared (first use in this function)
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1103: error: (Each undeclared identifier is reported only once
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1103: error: for each function it appears in.)
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1105: error: ‘TX_POWER_LIMITED’ undeclared (first use in this function)
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1111: error: ‘TX_POWER_FIXED’ undeclared (first use in this function)
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c: At top level:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1594: warning: initialization from incompatible pointer type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1596: warning: initialization from incompatible pointer type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1597: warning: initialization from incompatible pointer type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1598: warning: initialization from incompatible pointer type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1599: warning: initialization from incompatible pointer type
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_inform_single_bss’:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:1764: error: too few arguments to function ‘ieee80211_channel_to_frequency’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_bss_roaming_done’:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2090: warning: passing argument 2 of ‘cfg80211_roamed’ from incompatible pointer type
include/net/cfg80211.h:3124: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘u8 *’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2090: warning: passing argument 4 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3124: note: expected ‘const u8 *’ but argument is of type ‘s32’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2090: warning: passing argument 5 of ‘cfg80211_roamed’ makes integer from pointer without a cast
include/net/cfg80211.h:3124: note: expected ‘size_t’ but argument is of type ‘u8 *’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2090: warning: passing argument 6 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3124: note: expected ‘const u8 *’ but argument is of type ‘s32’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2090: error: too few arguments to function ‘cfg80211_roamed’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c: In function ‘wl_bss_connect_done’:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: warning: passing argument 2 of ‘cfg80211_roamed’ from incompatible pointer type
include/net/cfg80211.h:3124: note: expected ‘struct ieee80211_channel *’ but argument is of type ‘u8 *’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: warning: passing argument 4 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3124: note: expected ‘const u8 *’ but argument is of type ‘s32’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: warning: passing argument 5 of ‘cfg80211_roamed’ makes integer from pointer without a cast
include/net/cfg80211.h:3124: note: expected ‘size_t’ but argument is of type ‘u8 *’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: warning: passing argument 6 of ‘cfg80211_roamed’ makes pointer from integer without a cast
include/net/cfg80211.h:3124: note: expected ‘const u8 *’ but argument is of type ‘s32’
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: error: too few arguments to function ‘cfg80211_roamed’
make[2]: *** [/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.o] Error 1
make[1]: *** [_module_/home/joshis1/hybrid_wl] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.32-358.18.1.el6.x86_64'
make: *** [all] Error 2
How can I solve this? What am I missing? I have updated the Broadcom support group email id also, here linux-wlan-client-support-list#broadcom.com. Broadcom is a leading company, and I expect them to help here. I have emailed them also. Broadcom can share their solution here only, so that the world can get a benefit from it.
To Broadcom,
I have posted this on stack overflow, since every one can get an advantage of it. At the moment, I am unable to use WIFI on my laptop. I am stuck with the wired connection . Please help me so that I can get the WIFI working. When nothing was building, I tried the following with the latest release.
make API=WEXT (deprecated) ----> I am following the readme file.
This detects the wifi networks available, but it is unable to connect to the AP. Looks like this needs Wireless extension tools.
Do, I need to install anything for it. Or do you say, don't use the deprecated build rule, instead fix the build error? Whatever is your suggestion on it?
suggestion, I can follow on it.
The key is here:
/home/joshis1/hybrid_wl/src/wl/sys/wl_cfg80211_hybrid.c:2122: error: too few arguments to function ‘cfg80211_roamed’
If you check wl_cfg80211_hybrid.c ~line 2122
cfg80211_roamed(ndev,
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 39)
NULL,
#endif
(u8 *)&wl->bssid, conn_info->req_ie, conn_info->req_ie_len,
conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
WL_DBG(("roaming result\n"));
}
Although I'm running RHEL6.5 with 2.6.32 it's running a version of net/cfg80211.h that expects the extra argument so I needed to change the line to:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 32) - or just remove the if/endif completely. Unfortunate it doesn't stop there,that's about a dozen KERNEL_VERSION if's in wl_cfg80211_hybrid.c which need to be changed.
Once complete (you can test but running 'make' and going back and fixing the errors) it does compile and install fine. I'm running it now with WPA etc.. as expected. It seems it's just RedHat bringing in some cfg80211 from a more recent kernel into 2.6.32 that confuses the module.
I had the exact same problem with a friend's CentOS 6.4 Acer laptop (BCM 43227 WiFi) last week. The Broadcom driver would build only with API=WEXT option (otherwise, same error messages as you quoted), but then it worked only with "open" WiFi networks, not WPA/WPA2 (don't know about WEP). In /var/log/wpa_supplicant.log I got error message association request to the driver failed when trying to connect to WPA network and NetworkManager would just keep asking for the password.
Besides compiling the Broadcom driver directly, I also tried building RPM packages as suggested by ELRepo wl-kmod Howto (via CentOS wiki), but that failed as well (the Broadcom file names were different then the RPM expected).
I looked at the computer again this weekend and realized the RPM files linked in the ELRepo Howto had changed and the document itself was updated on 26th of September. So I tried again with the newer RPMs, following the instructions exactly and this time it worked. Got an RPM file which installed wl.ko kernel module. Loaded it via modprobe wl, after that NetworkManager found my WPA2 wifi and connected on first try.

module_main.c:43: error: invalid use of undefined type ‘struct nf_hook_ops’

I am creating a Manet using the protocol ARAN. To install the protocol I'm using this manual, but the first step, the creation of trace_route, I received errors such as:
module_main.c:43: error: invalid use of undefined type ‘struct nf_hook_ops’
module_main.c:45:'KERNEL_INFO' undeclared (first use in this function)
I searched the web and found out that the problem is in the netfilter, but I do not find the solution ...
P.S. I am using Ubuntu 10.04 LTS Kernel 2.6.33 recompiled

compiling rtmpdump for arm

I am trying to compile rtmpdump (http://rtmpdump.mplayerhq.hu/) for Qnap NAS 419p (arm)
I am not very exprenced with linux or compilation but am trying to learn.
make is complaining that it cant find openssl and im not sure where to start?
[/share/Qdownload/src] # ipkg install openssl
Package openssl (0.9.8v-2) installed in root is up to date.
Nothing to be done
Successfully terminated.
confirms that i have installed openssl
[/share/Qdownload/src] #
[/share/Qdownload/src] # ipkg install zlib
Package zlib (1.2.5-1) installed in root is up to date.
Nothing to be done
Successfully terminated.
[/share/Qdownload/src] #
confirms i have zlib the only other depenance i think i need.
[/share/Qdownload/src] # make linux
make[1]: Entering directory `/share/MD0_DATA/Qdownload/src'
g++ -Wall -O2 -c -o rtmp.o rtmp.cpp
In file included from rtmp.h:44,
from rtmp.cpp:42:
dh.h:22:24: error: openssl/bn.h: No such file or directory
dh.h:23:24: error: openssl/dh.h: No such file or directory
dh.h:25:25: error: openssl/sha.h: No such file or directory
dh.h:26:26: error: openssl/hmac.h: No such file or directory
dh.h:27:25: error: openssl/rc4.h: No such file or directory
In file included from rtmp.h:44,
from rtmp.cpp:42:
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'y' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'p' was not declared in this scope
dh.h:34: error: 'BIGNUM' was not declared in this scope
dh.h:34: error: 'q' was not declared in this scope
dh.h:34: error: initializer expression list treated as compound expression
dh.h:35: error: expected constructor, destructor, or type conversion before '*' token
dh.h:36: error: 'DH' was not declared in this scope
dh.h:36: error: 'dh' was not declared in this scope
dh.h:37: error: 'DH' was not declared in this scope
dh.h:37: error: 'dh' was not declared in this scope
dh.h:37: error: expected primary-expression before '*' token
dh.h:37: error: 'pubkey' was not declared in this scope
dh.h:37: error: expected primary-expression before 'nPubkeyLen'
dh.h:37: error: initializer expression list treated as compound expression
dh.h:38: error: 'DH' was not declared in this scope
dh.h:38: error: 'dh' was not declared in this scope
dh.h:38: error: expected primary-expression before '*' token
dh.h:38: error: 'privkey' was not declared in this scope
dh.h:38: error: expected primary-expression before 'nPrivkeyLen'
dh.h:38: error: initializer expression list treated as compound expression
dh.h:39: error: 'DH' was not declared in this scope
dh.h:39: error: 'dh' was not declared in this scope
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'pubkey' was not declared in this scope
dh.h:39: error: expected primary-expression before 'nPubkeyLen'
dh.h:39: error: expected primary-expression before '*' token
dh.h:39: error: 'secret' was not declared in this scope
dh.h:39: error: initializer expression list treated as compound expression
dh.h:40: error: variable or field 'DHFree' declared void
dh.h:40: error: 'DH' was not declared in this scope
dh.h:40: error: 'dh' was not declared in this scope
In file included from rtmp.cpp:42:
rtmp.h:97: error: ISO C++ forbids declaration of 'DH' with no type
rtmp.h:97: error: expected ';' before '*' token
rtmp.h:98: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:98: error: expected ';' before '*' token
rtmp.h:99: error: ISO C++ forbids declaration of 'RC4_KEY' with no type
rtmp.h:99: error: expected ';' before '*' token
rtmp.cpp: In member function 'int RTMP_LIB::CRTMP::ReadN(char*, int)':
rtmp.cpp:653: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyIn'
rtmp.cpp:654: error: 'RC4' was not declared in this scope
rtmp.cpp: In member function 'bool RTMP_LIB::CRTMP::WriteN(const char*, int)':
rtmp.cpp:672: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'struct RTMP_LIB::LNK' has no member named 'rc4keyOut'
rtmp.cpp:674: error: 'RC4' was not declared in this scope
make[1]: *** [rtmp.o] Error 1
make[1]: Leaving directory `/share/MD0_DATA/Qdownload/src'
make: *** [linux] Error 2
[/share/Qdownload/src] #
Thanks for any advice you can give.
Make sure to install the development versions of the openssl and zlib packages.
Also make sure that openssl directory is somewhere in standard system include directories which should be /usr/include and /usr/local/include and some others depending on your tool chain.
But don't take my word for it and execute cpp -v < /dev/null. It runs the GNU C Preprocessor with input from /dev/null. Should print the directory search paths. Look for "#include <...> search starts here:" followed by a list of standard include search paths. This is also the order of inclusion.
If you are compiling for ARM it is not enough to install libraries for your own distro... you need libraries and a cross-compiler which runs on your development machine (probably x86 or x86_64) but generates code for the target platform (ARM).
If you don't have a cross-compiler for this Qnap NAS, this link should help you generate one with crosstool-ng, which is a great tool which helps you build cross-compilers from scratch. Then you will probably need a root filesystem with libraries made for your target platform too.
Everything involving cross-compiling is non-trivial, but we can try to help. What distro are you running on your machine?

building android-ndk?

I want to build an off-line speech recognition application for android.For that i tried building android NDK.But when i give ndk-build command i get the following error.I have no idea what that means as i am very new to Linux environment..Anyone please help me.
Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.
/home/cenuser/android/android-ndk-r7b/build/core/build-local.mk:130: *** Android NDK: Aborting . Stop.
and when i changed the location to i got this
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:760:26: error: pocketsphinx.h: No such file or directory
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:761:28: error: sphinxbase/err.h: No such file or directory
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Hypothesis':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:780: warning: initialization makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:782: warning: assignment makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:784: warning: assignment makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_0':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: (Each undeclared identifier is reported only once
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:795: error: for each function it appears in.)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Config__SWIG_1':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:799: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Config_getString':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:830: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_0':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:839: error: 'FALSE' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'new_Decoder__SWIG_1':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:843: warning: initialization makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getConfig':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:847: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getUttid':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:856: warning: return makes pointer from integer without a cast
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Decoder_getHyp':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: 'int32' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:869: error: expected ';' before 'best_score'
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:870: error: 'best_score' undeclared (first use in this function)
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c: In function 'Java_edu_cmu_pocketsphinx_pocketsphinxJNI_Decoder_1processRaw_1_1SWIG_10':
/home/cenuser/android/sphinx/PocketSphinxDemo/jni/pocketsphinx_wrap.c:1441: warning: assignment discards qualifiers from pointer target type
make: *** [/home/cenuser/android/sphinx/PocketSphinxDemo/obj/local/armeabi/objs-debug/pocketsphinx_jni/pocketsphinx_wrap.o] Error 1
Go to the ndk root folder from terminal
Type the command with your project path
ndk-build -C your_project_path
This will solve the problem. If you want more information on "ndk-build" command just type the command
ndk-build --help
This usually happens when you invoke ndk-build from incorrect diretory. You must be in folder which contains jni subdirectory.
Or alternatively do what error message tells you - specify NDK_PROJECT_PATH to correct folder.
you need to declare the path to the location while running the ndk-build command
1. cd
2. ndk-build NDK_PROJECT_PATH=
Go to /build/core
Change the NDK_PROJECT_PATH to app project path
Open terminal
Go to Project folder
Run the NDK_BUILD
This could be solves as follows:
I have faced the same problem. I was working on an text recognition application.
1- You should go the directory of your folder (which is inside the AndroidStudioProjects - "YOUR PROJECT",
2- There should be a jni (Java Native interface) folder. Search for this folder. whenever, this is found.
3- cd in cmd to that folder (The Parent folder of jni).
4- run **ndk-build**

Resources