Note that there are some explanatory texts on larger screens.

plurals
  1. POstatic libpcap in cross compiled Android arm-v7-a C code
    primarykey
    data
    text
    <p>I need to build a static library from the latest libpcap and "include" it in a C source code to be cross-compiled for an ARM-v7-a architecture (Nexus One).</p> <p>I've been trying for days, hope someone could give me an hint.</p> <p>And I <strong>can't</strong> use neither NDK nor Java-wrapper functions. It needs to be like:</p> <p>$ -o prog prog.c [-options] and later I'll be able to push the executable via adb.</p> <p>I've tried with CodeSourcery and arm-linux-gnueabi installed via apt-get (i'm on Kubuntu Linux), nothing worked properly.</p> <p>The most I've reached to achieve is a stupid simply helloworld file through:</p> <blockquote> <p>arm-linux-gnueabi-gcc -static -o prog prog.c</p> </blockquote> <p>which is executed under my smartphone.</p> <p>Do you have any clue about I can get a more complex program including libpcap? I think it should deal with .a or .so files in libpcap directory but I really don't figure it out... Thanks in advance</p> <p><em><strong>EDIT - SOLVED</em></strong>: Just as auselen said, I've tried with NDK stand-alone toolchain and I've succeded.</p> <p>This is what I've done, in case somebody would have my same issues:</p> <p>1) Download Android SDK and NDK (the latter is at r8d version at this time)</p> <p>2) Go into NDK folder and type</p> <blockquote> <p>cd build/tools</p> <p>make-standalone-toolchain.sh --platform=android-3 --install-dir=$HOME/new_toolchain --ndk-dir=YOUR_NDK_PATH</p> <p>cd $HOME/new_toolchain</p> </blockquote> <p>(I've put my helloworld.c file in this folder but of course you can add PATH into your .bashrc file for more efficiency)</p> <blockquote> <p>bin/arm-linux-androideabi-gcc helloworld.c -o helloworld</p> </blockquote> <p>3)push it into your device through adb.</p> <p>All is working now :) thanks again</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload