gcj-3.3.1 can compile to bytecode, but not to object code

Jeff Sturm jsturm@one-point.com
Sat Sep 20 03:46:00 GMT 2003


On Fri, 19 Sep 2003, Everton da Silva Marques wrote:
> 1) I'm failing to make gcj to compile
> xmlrpc/servlet/test-case to object code. I get this error:
>
> $ gcj --main=sample.RpcServer --classpath=src:servletapi-2.3-alpha1/source:xmlrpc-1.2-b1/src/java -o server src/sample/RpcServer.java
> /tmp/ccX8wsuM.o(.text+0x1e): In function `sample::RpcServer::main(JArray<java::lang::String*>*)':
> : undefined reference to `org::apache::xmlrpc::WebServer::class$'

You are compiling only the RpcServer class to object code with this
example.  The linker fails because it does not find compiled objects for
the other needed classes.

It may be easier to compile .java->.o one file at a time, and link
them all together as a file step, e.g.:

gcj -c Class1.java
gcj -c Class2.java
gcj -c Class3.java
gcj --main=example.Main Class1.o Class2.o Class3.o -o Program

> 2) gij reports this error:
>
> $ gij-3.3 -classpath dist/sample.jar:dist/xmlrpc.jar:dist/servlet.jar sample.RpcClient
> could not call XML-RPC method: java.io.IOException: Malformed HTTP header

I'm not sure what's going wrong here.

I know others have tried XML-RPC with gcj and reported success.  Try
searching the gcj archives.

Jeff



More information about the Java mailing list