Compiling C from SSH using GCC

6 replies [Last post]
stephenmac7
Title: NooBot
Joined: 11/19/2013
Posts:
BotPoints: 29
User offline. Last seen 9 years 6 weeks ago.

I was wondering how the botball compiles files in its GUI Using gcc. I have tried including everything in /usr/include/ that is related to botball without success.

ruler501
ruler501's picture
Title: NooBot
Joined: 01/29/2012
Posts:
BotPoints: 367
User offline. Last seen 8 years 4 weeks ago.

I can't remember the file but if you do a recursive grep in /etc(I believe though I may be wrong) for -lkovan there is a file with the command line options for compilation.

stephenmac7
Title: NooBot
Joined: 11/19/2013
Posts:
BotPoints: 29
User offline. Last seen 9 years 6 weeks ago.

For future reference, I got it working and wrote a piece of software in python to do it for me: https://github.com/Fletcher-Robotics/Botball2014/blob/master/autocompile...
Just in case the link goes down, here's an example:

gcc -include stdio.h -include kovan/kovan.h -c bbstd.c
gcc -include stdio.h -include kovan/kovan.h -include target.h -c test.c
gcc -o test *.o -lkovan -lm -lpthread

Where bbstd.c is a library file and test.c is the file we want to run (the one with main in it)

mklein
Title: NooBot
Joined: 01/15/2014
Posts:
BotPoints: 14
User offline. Last seen 7 years 34 weeks ago.

Why don´t you use a simple Makefile? I think this would be much easier than using complex scripts.

stephenmac7
Title: NooBot
Joined: 11/19/2013
Posts:
BotPoints: 29
User offline. Last seen 9 years 6 weeks ago.

Don't have experience with makefiles. It's easier to use technology you already know. Plus, it didn't occur to me.

peterstrong
peterstrong's picture
Title: NooBot
Joined: 07/05/2016
Posts:
BotPoints: 12
User offline. Last seen 5 years 40 weeks ago.

there is a file with the command line options for compilation.

Ponivnret
Title: NooBot
Joined: 07/29/2016
Posts:
BotPoints: 22
User offline. Last seen 6 years 44 weeks ago.

This is a very good post which I really enjoy reading. It is not every day that I have the possibility to see something like this.
get help with file explorer in windows 10