User forums > Using Code::Blocks
How to set up C::B for Android NDK compiler?
MortenMacFly:
...btw: You are not down the road once you made this work I can tell you - you'll need to do a lot low-level stuff in addition so it actually not only compiles, but also links.
My suggestion: Try at the command line first with the "hello world" project. Because you'll definitely need the platform flags, #defines and a lot more to setup your compiler correctly. Its easy if you see the command line one time so you are not stepping in the dark (...at least I found no good tutorial about it).
amarty:
--- Quote from: MortenMacFly on November 15, 2012, 10:22:25 pm ---...btw: You are not down the road once you made this work I can tell you - you'll need to do a lot low-level stuff in addition so it actually not only compiles, but also links.
My suggestion: Try at the command line first with the "hello world" project. Because you'll definitely need the platform flags, #defines and a lot more to setup your compiler correctly. Its easy if you see the command line one time so you are not stepping in the dark (...at least I found no good tutorial about it).
--- End quote ---
Configuring compilers flags for android platfrom seems not hard for me - I can grab them from eclipse build logs, so, I think, this is next step after NDK compiler can run under C::B.
Currently I'm really thinking about the work from the command line, but using C :: B would be much more convenient.
UPD Setting "C compiler" same as "C++ compiler" to g++ not solve the problem.
MortenMacFly:
--- Quote from: amarty on November 15, 2012, 10:29:45 pm ---Configuring compilers flags for android platfrom seems not hard for me - I can grab them from eclipse build logs
--- End quote ---
Can you provide me with one here, so I can try, too?
--- Quote from: amarty on November 15, 2012, 10:29:45 pm ---Currently I'm really thinking about the work from the command line, but using C :: B would be much more convenient.
--- End quote ---
Sure, in the end it will be way more convenient - but I said that to get the command line - if you have the Eclipse way - do it like this.
--- Quote from: amarty on November 15, 2012, 10:29:45 pm ---UPD Setting "C compiler" same as "C++ compiler" to g++ not solve the problem.
--- End quote ---
Well that is weird. What you can try now: Use the EnvVar plugin and clean up your PATH environment variable. You have plenty of compilers in the path, so this may interfere.
Alternatively, just create yourself a batch file like this:
--- Code: ---set CB_ROOT=[...DO IT!...]
set WIN_ROOT=[...DO IT!...]
SET PATH=%WIN_ROOT%;%WIN_ROOT\sytem32;%CB_ROOT%
"%CB_ROOT%\codeblocks.exe" %*
--- End code ---
...and run it.
amarty:
--- Quote from: MortenMacFly on November 15, 2012, 10:44:22 pm ---
--- Quote from: amarty on November 15, 2012, 10:29:45 pm ---Configuring compilers flags for android platfrom seems not hard for me - I can grab them from eclipse build logs
--- End quote ---
Can you provide me with one here, so I can try, too?
--- End quote ---
--- Code: ---**** Build of configuration Default for project GorgeousKarnaugh ****
bash D:\android-ndk-r8b\\ndk-build V=1
Invalid attribute name:
package
rm -f ./libs/armeabi/lib*.so ./libs/armeabi-v7a/lib*.so ./libs/mips/lib*.so ./libs/x86/lib*.so
rm -f ./libs/armeabi/gdbserver ./libs/armeabi-v7a/gdbserver ./libs/mips/gdbserver ./libs/x86/gdbserver
rm -f ./libs/armeabi/gdb.setup ./libs/armeabi-v7a/gdb.setup ./libs/mips/gdb.setup ./libs/x86/gdb.setup
Compile++ arm : GorgeousKarnaugh <= GorgeousKarnaugh.cpp
/d/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs/GorgeousKarnaugh/GorgeousKarnaugh.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/d/agg-2.5/include -I/f/work/carno/include -I/d/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include -I/d/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -I/d/android-ndk-r8b/sources/cxx-stl/system/include -Ijni -DANDROID -Werror -Wa,--noexecstack -O2 -DNDEBUG -g -I/d/android-ndk-r8b/platforms/android-14/arch-arm/usr/include -c jni/GorgeousKarnaugh.cpp -o ./obj/local/armeabi/objs/GorgeousKarnaugh/GorgeousKarnaugh.o && ./obj/convert-dependencies.sh ./obj/local/armeabi/objs/GorgeousKarnaugh/GorgeousKarnaugh.o.d
In file included from jni/GorgeousKarnaugh.cpp:2:0:
d:/android-ndk-r8b/platforms/android-14/arch-arm/usr/include/jni.h:592:13: note: the mangling of 'va_list' has changed in GCC 4.4
Compile arm : GorgeousKarnaugh <= gkcstuff.c
/d/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-gcc -MMD -MP -MF ./obj/local/armeabi/objs/GorgeousKarnaugh/gkcstuff.o.d.org -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv5te -mtune=xscale -msoft-float -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/d/agg-2.5/include -I/f/work/carno/include -I/d/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include -I/d/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include -I/d/android-ndk-r8b/sources/cxx-stl/system/include -Ijni -DANDROID -Werror -Wa,--noexecstack -O2 -DNDEBUG -g -I/d/android-ndk-r8b/platforms/android-14/arch-arm/usr/include -c jni/gkcstuff.c -o ./obj/local/armeabi/objs/GorgeousKarnaugh/gkcstuff.o && ./obj/convert-dependencies.sh ./obj/local/armeabi/objs/GorgeousKarnaugh/gkcstuff.o.d
SharedLibrary : libGorgeousKarnaugh.so
/d/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/
arm-linux-androideabi-g++ -Wl,-soname,libGorgeousKarnaugh.so
-shared --sysroot=/d/android-ndk-r8b/platforms/android-14/arch-arm
./obj/local/armeabi/objs/GorgeousKarnaugh/GorgeousKarnaugh.o ./obj/local/armeabi/objs/GorgeousKarnaugh/gkcstuff.o ./obj/local/armeabi/libstdc++.a
-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
-L/d/android-ndk-r8b/platforms/android-14/arch-arm/usr/lib
-lstdc++ -lc -lm -o obj/local/armeabi/libGorgeousKarnaugh.so
Install : libGorgeousKarnaugh.so => libs/armeabi/libGorgeousKarnaugh.so
mkdir -p ./libs/armeabi
install -p ./obj/local/armeabi/libGorgeousKarnaugh.so ./libs/armeabi/libGorgeousKarnaugh.so
/d/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-strip --strip-unneeded ./libs/armeabi/libGorgeousKarnaugh.so
--- End code ---
--- Quote from: MortenMacFly on November 15, 2012, 10:44:22 pm ---
--- Quote from: amarty on November 15, 2012, 10:29:45 pm ---UPD Setting "C compiler" same as "C++ compiler" to g++ not solve the problem.
--- End quote ---
Well that is weird. What you can try now: Use the EnvVar plugin and clean up your PATH environment variable. You have plenty of compilers in the path, so this may interfere.
Alternatively, just create yourself a batch file like this:
--- End quote ---
--- Code: ---set CB_ROOT=C:\Program Files (x86)\CodeBlocks
set WIN_ROOT=C:\Windows
SET PATH=%WIN_ROOT%;%WIN_ROOT\system32;%CB_ROOT%
"%CB_ROOT%\codeblocks.exe" %*
--- End code ---
Same result - error.
dmoore:
Didnt we once have issues with mingw installed on d drive and C::B on c drive on win 7? Did you try putting everything on one drive?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version