|
Android and allegro5 error cmake |
Iwan91
Member #14,487
August 2012
|
I'm using cywin on Windows 7 to compile allegro5 (5.1.7) with android-ndk-r8e. I get: -- Selected Android toolchain: c:/androidSDK/android-ndk-r8e/toolchains It fails with the following output: CMake will not be able to correctly generate this project. CMake Error: your C compiler: "c:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. This file c:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-gcc exist but cmake don't see him. I don't know why. |
Max Savenkov
Member #4,613
May 2004
|
Do not use cygwin's cmake to create project, it won't work. Use Windows cmake, and it will create cygwin-compatible makefile.
|
Iwan91
Member #14,487
August 2012
|
When I tried windows camke (GUI) I get too error. Selected Android toolchain: C:/androidSDK/android-ndk-r8e/toolchains It fails with the following output:
CMake will not be able to correctly generate this project. CMake Error: your C compiler: "C:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. Here screenshot: http://imageshack.us/a/img46/1848/cmake.png |
Max Savenkov
Member #4,613
May 2004
|
It's strange that it's trying to find an RC compiler. I didn't try to get cmake-gui to create Android project for me. Command line cmake, on the other hand, worked (but make sure you're using Windows console cmake; check output of 'which cmake' if you have cygwin in your PATH). I used the following command line (inside allegro-5.1.6\buildandroid\ dir that I created): cmake -G"Unix Makefiles" -DANDROID_NDK_TOOLCHAIN_ROOT=C:\alleg\android_toolchain\ -DWANT_ANDROID=on -DWANT_EXAMPLES=OFF -DWANT_DEMO=OFF -DCMAKE_BUILD_TYPE=Debug -DWANT_MONOLITH=ON -DWANT_X11=OFF -DCMAKE_VERBOSE_MAKEFILE=ON ..
|
Iwan91
Member #14,487
August 2012
|
When I add windows cmake to environment variables PATH and then want compile in cygwin I get this error: -- Building for: Visual Studio 9 2008 Cygwin using widnows cmake. When I use windows cmd I get: -- Selected Android toolchain: c:/androidSDK/android-ndk-r8e/toolchains It fails with the following output: Change Dir: C:/androidSDK/android-ndk-r8e/toolchains/build/CMakeFiles/CMakeTm Run Build Command:C:\PROGRA~2\Borland\Delphi7\Bin\make.exe MAKE Version 5.2 Copyright (c) 1987, 1998 Inprise Corp. Fatal: Unable to open makefile CMake will not be able to correctly generate this project. -- Configuring incomplete, errors occurred! |
Max Savenkov
Member #4,613
May 2004
|
"Check for working C compiler using: Visual Studio 9 2008" - this is strange. Did you specify -G"Unix Makefiles" in command line? I do not see this switch in your initial command line, but you NEED to specify it. (You should run Windows cmake from Windows command line).
|
Iwan91
Member #14,487
August 2012
|
When I specify my command with -G "Unix Makefiles" on cygwin or widnows cmd cmake -G"Unix Makefiles" d:/Projekty/C++/android_allegro5/allegro/ -DANDROID_NDK_TOOLCHAIN_ROOT=c:/androidSDK/android-ndk-r8e/toolchains -DWANT_ANDROID=on -DWANT_EXAMPLES=OFF -DWANT_DEMO=OFF -DCMAKE_BUILD_TYPE=Debug I get again error: It fails with the following output: CMake will not be able to correctly generate this project. CMake Error: your C compiler: "c:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-gcc" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name. c:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-gcc really exist but cmake don't see him. |
Max Savenkov
Member #4,613
May 2004
|
I don't really know what's wrong, but I see one more suspicious thing. Notice how it looks for "c:/androidSDK/android-ndk-r8e/toolchains/bin/arm-linux-androideabi-g++" - without ".exe"! This usually happens when you try to use cygwin cmake, because under cygwin CMAKE_EXECUTABLE_SUFFIX is an empty string, and under Windows it's ".exe" (see cmake/Toolchain-android.cmake for its use). I had exactly the same problem, but my only solution was to use Windows cmake, this helped me. I assume you did create standalone android toolchain?
|
Iwan91
Member #14,487
August 2012
|
"I assume you did create standalone android toolchain?" When I add .exe suffix I still get errors: -- Configuring incomplete, errors occurred! |
Max Savenkov
Member #4,613
May 2004
|
A-ha! But we're getting somewhere. Now, compiler is OK, but size checks are failing. I've checked my notes and found I had this problem too. For now, nothing to do about it, but disabled failing check. Modify your CMakeLists.txt, by commenting out this lines: #include(TestBigEndian) #if(NOT IPHONE)
|
Iwan91
Member #14,487
August 2012
|
Thanks a lot. |
Max Savenkov
Member #4,613
May 2004
|
Good luck. It isn't so hard, although I prefer to use Visual Studio plugin from NVidia to do my Android development and soon will be getting a Tegra-based device specifically to get the most out of it.
|
Iwan91
Member #14,487
August 2012
|
I'm new to programming on android. I do this step: Run the ndk-build script from the NDK while in the root directory of your 1. ANDROID_NDK_TOOLCHAIN_ROOT=$TC /home/username/android-ndk/ndk-build 2. Run "android update project -p .". 3. Run ant debug. This should completely build your project Now I have problem with NDK when perform step 1. Android NDK: ERROR:jni/Android.mk:allegro-prebuilt: LOCAL_SRC_FILES points to a I don't have liballegro-debug.so file on HDD. I checked Allegro5 and NDK folder. Do you think that can be problem with build cmake before because I get in cmd: |
Max Savenkov
Member #4,613
May 2004
|
I never tried to compile allegro-based projects with command-line tools, so maybe someone else can help you with your errors. As for VS plugin, while it's easier to use in the long run, it have some initial problems, the main being there is no ready-made project to compile Allegro for it. I managed it in about a week of mucking around, but I don't have a ready instruction on how to do it. I assume you wouldn't want to repeat my effort right now, because it will take too much time. Still, if you're interested, you'll have to register at NVidia developers site (https://developer.nvidia.com/) apply for Tegra Developer Program, wait for approval (usually several days, but I had to wait a few weeks because of site glitch) and then download Nvidia Tegra Android Developer Pack 2.0 (TADP). It will include a plugin for Visual Studio (>=2010) as well as a copy of NDK and other Android stuff. EDIT: now that I wrote it, it sounds awful
|
Iwan91
Member #14,487
August 2012
|
Why programming in c++ on android must be so complicated :/ |
Thomas Fjellstrom
Member #476
June 2000
|
You need to copy the built allegro libs into your project's 'jni/armeabi-v7a' folder. also, when you did step #1 above, what did you set $TC to? I'm assuming right now that it was never actually set, so what actually happened was you ran: `ANDROID_NDK_TOOLCHAIN_ROOT= /home/username/android-ndk/ndk-build` Because $TC was never set to anything. Also I hope you actually ran ndk-build from the right location, and not /home/username/android-ndk/ndk-build because that is almost certainly not where it would be located. Iwan91 said: Why programming in c++ on android must be so complicated :/ The Native development platform for Android is Linux. Especially so when using the NDK. There are various tools (ie: the classic Eclipse Android tools, the new Android Studio IDE from Google based on IntelliJ, and NVidia's Tegra toolkit) you can use to make android dev on other platforms a bit easier, but its still not going to be as easy. Also, Google may never make Native development on Android easy. they really don't want it to be. You're supposed to make Android/Java applications, not native C/C++ applications. -- |
Iwan91
Member #14,487
August 2012
|
"You need to copy the built allegro libs into your project's 'jni/armeabi-v7a' folder." I have: I add to Widnows environemnt variable(PATH), path to c:\androidSDK\android-ndk-r8e\ Android NDK: ERROR:jni/Android.mk:allegro-prebuilt: LOCAL_SRC_FILES points to a missing file It's weird because I don't have files *.so on my HDD. I was looking everywhere but no luck. Maybe I do something wrong, because it's my first time when I compile application on android. I want to know if default pack with allegro 5.1.7 have in android-project folder example project? I forgot about something when I do: mkdir build CMakeFiles/allegro_monolith.dir/build.make:55: *** wzorzec obiektu nie zawiera `%'. Stop. |
Thomas Fjellstrom
Member #476
June 2000
|
Iwan91 said: You mean allegro_monolith-debug-5.pc ? because I have only this one. No. Shared Libraries end in .so, static end in .a (I'm not sure we have static libs working with android atm). Quote: It's weird because I don't have files *.so on my HDD. I was looking everywhere but no luck. Then you didn't build allegro. Quote: I forgot about something when I do: Can you paste the exact commands you've run? not just the example commands from the readme? It's important. -- |
Iwan91
Member #14,487
August 2012
|
First I run this script: Result: Next I run this script: Result: Next I want run this: Result: I think that error in last command don't give me good files. |
Thomas Fjellstrom
Member #476
June 2000
|
Yup. The last command failed. I've never used cygwin to build allegro and the android stuff, so I can't really help there. Might be that you should try a different version of make? I'm not sure. -- |
Iwan91
Member #14,487
August 2012
|
I think that I find make.exe that can compile this. Command: But again I get error: What do you think? |
|