PDA

Bekijk de volledige versie : c compiler question olegs firmware



zwieback
25-01-2009, 15:22
Hi,

sorry for asking this implicitness but i want to know if there is a possibility to compile a c sourcefile like with gcc -o ... on olegs fimware.

I've checked ipkg list and installed for a kind of gcc pkg but i'am not sure enough with this stuff...

thanks in advance and kind regards,

zwieback

al37919
25-01-2009, 16:52
for the on-router compilation install optware-devel package. It's a meta-package which includes the most of needed things.

zwieback
25-01-2009, 19:47
al37919,

I've installed the optware but i didn't find the correct compiler. Could you specify me the correct compiler pls ?

al37919
25-01-2009, 22:28
I don't think I understand your question. To compile typical program you have to execute:

./configure
make
make install
More details usually can be found in the documentation to the sources. All the stuff needed to perform this is installed by the optware-devel package. It is better if you clarify what do you mean under "correct compiler".

zwieback
26-01-2009, 08:14
sorry, thats my mistake.

i want to compile the following like that:


----- newfile.c-----
#include <stdio.h>

void main()

{
printf("hello world!\n");
}
-----------------------

i want to get an executable file. I've done it with gcc on our SUN machines, but i haven't found something adequate on the wlhdd with olegs firmware.
I've looked at make but i think this wouldn't be ok for this.

But i believe there has to be something for this...

best regards

al37919
26-01-2009, 08:35
root@wl500g,~> gcc 1.c
1.c: In function ‘main’:
1.c:5: warning: return type of ‘main’ is not ‘int’
root@wl500g,~> ./a.out
hello world!
root@wl500g,~>
so, you see --- it is possible

zwieback
26-01-2009, 09:31
did you have oleg or open/dd-wrt installed on your wl500 ?

when I do gcc --help i got ambigious command as a reply. So for my understanding my wl-hdd didn't know gcc ?!

I think that I dont't have to reboot after installing the dev-package...

al37919
26-01-2009, 10:09
I have wl500gp with oleg's fw. wl-hdd shouldn't make any difference. Check if you have buildroot package installed. It should have been installed as a part of optware-devel.

Reboot shouldn't be needed. Check with:

type gcc
that gcc is installed and is available through PATH variable.

zwieback
26-01-2009, 11:48
thats it. buildroot pkg was missing. I've installed it and now gcc is known in the system path as well.

Thank you very much for your help.