Need your guidance, I am writing one app in android with the help of native code which will communicate with CAN (Controller Area Network) port ; for that in my C code i used linux/can.h header file. and i am following "http://mobilepearls.com/labs/ndk-builder-in-eclipse/" this link to build my app. but one i set all thing i got bellow msg in eclipse console box
Compile thumb : can_port <= cansend.c
jni/cansend.c:14:23: fatal error: linux/can.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/can_port/cansend.o] Error 1
One more thing, i am working on windows environment. But i don't think this may be cause.
It is correct that it is not a Windows/Linux problem. The simple problem is that compiler is unable to find the file can.h. Now, for your info, when the compiler starts compiling, it searches for its header files in the folder
C:\(path to NDK folder)\platforms\(android-version)\(arch)\usr\include\linux
Now, if there isn't a can.h there, the compiler will flag an error. So the best way is
Either copy can.h to the above path (not tested)
Modify your Makefile to path to the correct directory where this header file is kept
Hope this helps!
Related
I am compiling Android Kernel 3.18.
I am getting this error
drivers/built-in.o: In function `enable_extldo':
/home/vinay/customKernel/3.18/kernel_yu_msm8937/drivers/bluetooth/bluetooth-power.c:307: undefined reference to `cnss_get_platform_cap'
/home/vinay/customKernel/3.18/kernel_yu_msm8937/drivers/bluetooth/bluetooth-power.c:307:(.text+0x5c45bc): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `cnss_get_platform_cap'
Makefile:951: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
Here is the source code
I am using aarch64-linux-android-4.9 toolchain
I encountered the same problem when I tried to compile a kernel for a MI device.
First you can see the function cnss_get_platform_cap was declared in cnss.h which is located in include/net:
And you open this file you will find this function was declared as a extern one:
So it is only a declaration here, not a implement.
Then we have a dig where the function is, I used find command to find all cnss related driver files and I find this function was implemented in ./net/wireless/cnss/cnss_pci.c
As we can see, the function was here and it will be a exported symbol after compiling.
And you can log your compile process and you will find actually succeed to compile bluetooth-power.c
Just when the makefile link vmlinux it will be a problem. So here we are. I searched the log and I didn't find cnss_pci.c was ever compiled, only cnss_common.c was compiled, let's open the sub-makefile in net/wireless/cnss/
You will find you need to add a item in your defconfig file to compile cnss_pci.c which is 'CONFIG_CNSS_PCI=y'. I add it to my defconfig file in arch/arm64/configs/xxx_defconfig and I solved this.
I just tried to merge a vendor patch into a newer CAF kernel, and there are many many syntax errors even with auto merge.
As for the logic error and bugs, I don't know. A lot of things need to learn.
Hope you find your way out.
Im trying to build automation test cases using robot framework for android devices.
I have imported the android library and have installed python on my system.
My code is as follows:
*** Settings ***
Library OperatingSystem
Library Selenium2Library
Library AndroidLibrary
*** Test Cases ***
case1
Start Emulator avd_name='AVD_for_Nexus_5_by_Google',no_window=False, language=en, country=us
Wait For Device timeout=120
Press Menu Button
Stop Emulator
When I try to execute a test case, I get the error:
command: pybot.bat --argumentfile c:\users\kesav\appdata\local\temp\RIDEnhapet.d\argfile.txt --listener C:\Python27\lib\site-packages\robotframework_ride-1.3-py2.7-win32.egg\robotide\contrib\testrunner\TestRunnerAgent.py:52956:False C:\Users\kesav\test
[Error 2] The system cannot find the file specified.
I have checked the PATH environment variable, it contains C:\Python27 and C:\Python27\Scripts as well.
Please help!
First thing you are missing something from you path, make sure you path has:
;C:\Python27;C:\Python27\Scripts;C:\Python27\Lib\site-packages
You are missing site-packages from your path, try that and get back to me!
I'm trying to debug native application in Eclipse. Unfortunately, when I run "Debug As-> Android Native Application" I see the following errors in the console:
[2014-09-10 21:03:48 - GenderDetector] Verify if the application was built with NDK_DEBUG=1
[2014-09-10 21:04:16 - GenderDetector] gdbserver output:
[2014-09-10 21:04:16 - GenderDetector] run-as: Package 'com.opencv.genderdetector' is unknown
If I try to add "NDK_DEBUT=1" to the ndk-build command I see the following errors:
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.9] libs/armeabi-v7a/gdbserver
install: cannot stat ‘/home/yury/software/android-ndk/prebuilt/android-arm/gdbserver/gdbserver’: No such file or directory
make: *** [libs/armeabi-v7a/gdbserver] Error 1
Could someone please explain what I'm doing wrong?
Here is a steps that may help you :
Check if /home/yury/software/android-ndk/prebuilt/android-arm/gdbserver/gdbserver is exsits
Check if it has execution permission.
Add this path to your environment variables this maybe will help.
Make sure your android-ndk folder is complete as it comes from google when you download.
Regards.
Build your application like this : ndk-build NDK_DEBUG:=1 APP_OPTIM:=debug
This enables the debug flag and also creates symbol files used by the debugger. You will see 2 files gdbserver.so and gdb.setup created within jni/libs folder. After this is done, you are good to debug as native application.
I meet this error when I use android-ndk-r10. After I uses android-ndk-r10e, this error disappear.
I am trying to compile some source code but when i run the command
make -f android-9-armv7.mk
I get the following error
android-9-armv7.mk:1: * missing separator. Stop.
This is the contents of the file above:
And I have set the IMAGINE_PATH variable as well, cant seem to figure it out.
link ../imagine/make/shortcut/common-builds/android-9-armv7.mk
Compiling instructions
http://code.google.com/p/emu-ex-plus-alpha/wiki/Compiling
Imagine is locaed at C:/Imagine
I don't know where you've taken the sources, but all the android-9-armv7.mk files from different projects on that git has following content:
../imagine/make/shortcut/common-builds/android-9-armv7.mk
...there is no link keyword, which probably is why you get this error.
Also, please be informed that you're building this on Windows machine while documentation clearly states that it's supported only on Linux and Mac OS X.
I am trying to build a Gstreamer plugin(a surface texture sink) in android. I got this error along with several others:
"error: 'gint' has not been declared".
I did source build/envsetup.sh and then went into the sink directory and did "mm". Then I got the above error.
I believe I should include "gst.h" and "glib.h". But when I add these include lines, I get an error saying that these files cannot be located. So, I think that the path to these header files need to be set correctly. But I don't know how or where to set this path.
Should Android.mk be modified in some way ?
Kindly help
Thanks.
gint is declared in glib.h on all systems I have seen. Do you have glib installed?