From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ashwin Kapur To: help-gcc@gnu.org Subject: gcj Date: Tue, 30 Nov 1999 23:28:00 -0000 Message-ID: <383A1FEC.91ADBFCB@bellatlantic.net> X-SW-Source: 1999-11n/msg00353.html Message-ID: <19991130232800._JFHneijL6jrKfSa6upD0Y2mnR2pzZNcdWIZCiuGNCY@z> Sorry if this is off topic but I don't see a newsgroup for gcj specifically and this seems to be the closest one since it's a compiler specific question. I'm trying to compile some java code into a native binary on suse 6.2 using the gcj in gcc 2.95-2. The Problem: The java file compiles into an o file but the compiler complains about the absence of a main. The code contains a main. Is there some specific thing I'm supposed to be doing to compile and like code with gcj. Are there docs on this. Is there some library I'm supposed to link to or something. Thanks Ashwin Here is the source code. It is an example from the java tutorial. //--------------------------------------------------------------------- import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) throws IOException { Socket echoSocket = null; PrintWriter out = null; BufferedReader in = null; try { echoSocket = new Socket("coredump", 7); out = new PrintWriter(echoSocket.getOutputStream(), true); in = new BufferedReader(new InputStreamReader( echoSocket.getInputStream())); } catch (UnknownHostException e) { System.err.println("Don't know about host: coredump"); System.exit(1); } catch (IOException e) { System.err.println("Couldn't get I/O for " + "the connection to: coredump"); System.exit(1); } BufferedReader stdIn = new BufferedReader( new InputStreamReader(System.in)); String userInput; while ((userInput = stdIn.readLine()) != null) { out.println(userInput); System.out.println("echo: " + in.readLine()); } out.close(); in.close(); stdIn.close(); echoSocket.close(); } } //-------------------------------------------------------------------------- -- #include #include