6

I'm using Terminal-IDE as my development environment. (Google code site here.)

I'm running Terminal-IDE v 2.02 - the very latest. My Android versions are:

  • Android 4.0.3
  • Software version 2.14.531.3 71ORD
  • (the rest aren't likely pertinent, but more on request)

I'm in a suitable development directory with a simple enough c source code file ready and run 'make'.

I have never yet gotten any compilation to work successfully. Most likely, there's a version mis-match with regard to what executable is available versus what the software is looking for.

Here's the command and error message:

terminal-gcc -c -Wall -I/data/data/com.spartacusrex.spartacuside/files/local/include tester.c -o tester.o
/data/data/com.spartacusrex.spartacuside/files/system/bin/terminal-gcc[43]: arm-eabi-gcc: not found
make: *** [tester.o] Error 127

Snafu, of course. I'm not at all sure how to find out what the right compiler file name(s) should be because, on this non-rooted phone, I don't have permissions to hunt through the PATH and find the actual executables.

It may also be that PATH is set wrong. All input appreciated.

Richard T
  • 4,570
  • 5
  • 37
  • 49

2 Answers2

8

...I'm not sure what's supposed to happen, but I found in the Terminal-IDE directory tree the file:

$IDESYSTEM/android-gcc-4.4.0.tar.gz

I also found that terminal-gcc is a bash script. Looking inside it seemed to say that a gcc tree should exist in "$HOME", which is the installation directory. So, I unzipped, then un-tarred the file identified above and put the resulting directory tree as a top-level subdirectory.

Well well, what do you know? Success.

I went a little further and created soft links to the actual compiler in ~/bin for both gcc and just cc, and suddenly all my previously created "Makefile" scripts used in other projects I wanted to move over started working perfectly.

Apparently, even though I thought I'd done it right, I overlooked running this script:

./system/bin/install_gcc

It extracts the tar, like I did, but does not create the links you may need.

Hey, if you're glad I got here before you, give it a thumbs up!

Richard T
  • 4,570
  • 5
  • 37
  • 49
2

A credit goes to @Richard T for his enthusiasm regarding Terminal IDE. The answer is intended to enumerate the steps needed for running a C code.

To run a C code

  1. Run Terminal IDE and extract the gcc package by executing

    install_gcc

  2. Create a directory for your projects within the Terminal IDE directory tree. Then in the directory create a source .c file with some code (filename.c here). Compile it

    terminal-gcc -c filename.c

  3. Create the executable file

    terminal-gcc filename.o -o filename.out

  4. Run the output file

    ./filename.out


If you'd like to use the PC (laptop) keyboard you can telnet Terminal IDE.

To Telnet Terminal IDE

  1. From Terminal IDE start the telnetd deamon by executing

    telnetd

  2. Connect the Android device to the PC (laptop) and type

    adb forward tcp:[port] tcp:8080

    telnet 127.0.0.1 [port]

P.S. Telnet's default port is 23.

Onik
  • 19,396
  • 14
  • 68
  • 91
  • 1
    If you're like me, you're LOATH to _ever_ use telnet! Instead, I use ssh. There are pretty good directions for setting it up on the TerminalIDE web site - don't recall which one. You can try TerminalIDE.org, I think, and it links to the others. – Richard T Mar 04 '15 at 18:58