This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Building shared objects with gcj on osx
- From: jym at Cs dot Nott dot AC dot UK
- To: java at gcc dot gnu dot org
- Date: 04 Mar 2005 17:43:40 +0000
- Subject: Building shared objects with gcj on osx
- Source-info: From (or Sender) name not authenticated.
Hi,
I have a successful bootstrap build of 3.4.3 on os 10.2.8. When trying to
build shared objects, I am receiving link errors:
bash-2.05a$ cat ./Test.java
public class Test {
public static void main (String [] argsv) {
System.out.println ("Hello World");
}
}
bash-2.05a$ gcj -o helloworld --main=Test Test.java
bash-2.05a$ ./helloworld
Hello World
bash-2.05a$ gcj -shared -o helloworld.so Test.java
/usr/bin/ld: Undefined symbols:
_main
___eprintf
collect2: ld returned 1 exit status
bash-2.05a$
The link error on "main" makes me suspicous - I presumed using -shared
meant that no main was required?
I am fully aware I may be missing something obvious, and welcome any
(helpful :) critism on how to get this working.... is it possible that
weirdness is happening as OSX's /usr/bin/ld is used?
I have seen many messages on problems building native SWT/SwingWT on OSX,
which I am attempting - the Makefile in SwingWT for SWT uses the same flags
I have (although also tries to link in various jnilibs, in error I think).
This is what has led me to the problem of getting -shareds working on
osx.... any ideas?
Many TIA,
James
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.