stingray
12th September 2013, 23:48
So now im at it again...
trying to compile mysql-connector-c-6.1.1-src, but its a cmake file, and if i open it in qt creator, even thou i have selected arm-android toolchain, it uses the gcc from /usr/bin/gcc, so its successful, but i dont want a unix lib, i want a android lib...
so question is, can i somehow make a .pro file, that i can use to crosscompile this lib?
im pretty sure its possible to port this c code to android without any big modifications, but i dont really know where to start, it seems most i find on google, is about making a toolchain for cmake, so it crosscompiles, i've tryed that, but it just says that the compiler cant make a working testcompile, so the cmake process gets stuffed in the trashbin..
http://www.mymegabyte.com/2011/03/cross-compile-libmysql/
code below is what happens with the toolchain abowe, just switched out the compilers to android-gcc and android-g++ that i symlinked from the ndk r9 toolchains..
stingray@stingray-server:~/src/mysql-connector-c-6.1.1-src/build$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ..
-- Running cmake version 2.8.10.1
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec2945069581/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2945069581.dir/build.make
CMakeFiles/cmTryCompileExec2945069581.dir/build
make[1]: GÃ¥r till katalogen
"/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
/usr/bin/cmake -E cmake_progress_report
/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o
/home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
GNU -o CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o -c
/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/testCCompiler.c
arm-linux-androideabi-gcc: error: GNU: No such file or directory
make[1]: *** [CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o]
Fel 1
make[1]: Lämnar katalogen
"/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
make: *** [cmTryCompileExec2945069581/fast] Fel 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:99 (PROJECT)
-- Configuring incomplete, errors occurred!
this is also a intresting site http://code.google.com/p/android-cmake/
but its not much on how to use it, or im just plain stupid, cause i cant get it to work..
anyway i guess theres alot of people that have been bitching with this, and since they ported OpenCV, then it has to be possible, but question is how.. :)
trying to compile mysql-connector-c-6.1.1-src, but its a cmake file, and if i open it in qt creator, even thou i have selected arm-android toolchain, it uses the gcc from /usr/bin/gcc, so its successful, but i dont want a unix lib, i want a android lib...
so question is, can i somehow make a .pro file, that i can use to crosscompile this lib?
im pretty sure its possible to port this c code to android without any big modifications, but i dont really know where to start, it seems most i find on google, is about making a toolchain for cmake, so it crosscompiles, i've tryed that, but it just says that the compiler cant make a working testcompile, so the cmake process gets stuffed in the trashbin..
http://www.mymegabyte.com/2011/03/cross-compile-libmysql/
code below is what happens with the toolchain abowe, just switched out the compilers to android-gcc and android-g++ that i symlinked from the ndk r9 toolchains..
stingray@stingray-server:~/src/mysql-connector-c-6.1.1-src/build$ cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=`pwd`/install -DCMAKE_TOOLCHAIN_FILE=toolchain.cmake ..
-- Running cmake version 2.8.10.1
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
-- Check for working C compiler: /home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
"/home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/make "cmTryCompileExec2945069581/fast"
/usr/bin/make -f CMakeFiles/cmTryCompileExec2945069581.dir/build.make
CMakeFiles/cmTryCompileExec2945069581.dir/build
make[1]: GÃ¥r till katalogen
"/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
/usr/bin/cmake -E cmake_progress_report
/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object
CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o
/home/stingray/Qt/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc
GNU -o CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o -c
/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp/testCCompiler.c
arm-linux-androideabi-gcc: error: GNU: No such file or directory
make[1]: *** [CMakeFiles/cmTryCompileExec2945069581.dir/testCCompiler.c.o]
Fel 1
make[1]: Lämnar katalogen
"/home/stingray/src/mysql-connector-c-6.1.1-src/build/CMakeFiles/CMakeTmp"
make: *** [cmTryCompileExec2945069581/fast] Fel 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:99 (PROJECT)
-- Configuring incomplete, errors occurred!
this is also a intresting site http://code.google.com/p/android-cmake/
but its not much on how to use it, or im just plain stupid, cause i cant get it to work..
anyway i guess theres alot of people that have been bitching with this, and since they ported OpenCV, then it has to be possible, but question is how.. :)