OpenWrt Forum Archive

Topic: Linksys wrt54g with white russian 0.9 installed,compile c code

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have a router(linksys WRT54g v3.1) in which i have White Russian 0.9. I need to compile a c program. Till now I have compiled a hellowold program on this router using ssh. but now as I start adding more header files to run my code it starts giving errors


ERROR: /bin/helloworld: line 1: syntax error: “)” unexpected

i need to add following headers
<pcap.h>
<string.h>
<stdlib.h>

so tell me which packages i guess i must install first to make my code run
as i notice we need uclibc for <stdio.h>.

or incase something else i need to do to make it run.


Thank you

Sorry for not mentioning it correctly in the begining.


I am using sdk for white russian 0.9 for cross compiling my c code then creating package of my application(for eg helloworld) then installing that package on to router using ssh.

So now if I am creating a package using the above mentioned header files, then after installation when i run the application like this on router:

root@openwrt#helloworld
ERROR: /bin/helloworld: line 1: syntax error: “)” unexpected


it gives an error.


i need to add following headers to my code
<pcap.h>
<sys/socket.h>
<string.h>
<stdlib.h>
<netinet/in.h>
so tell me which packages i guess i must install first to make my code run
as i notice we need uclibc for <stdio.h>.
or incase something else i need to do to make it run.

Thank you

(Last edited by patiyal.manish on 24 Feb 2014, 09:50)

The discussion might have continued from here.