LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2003, 09:48 AM   #1
wslyhbb
Member
 
Registered: Apr 2002
Location: Chicago, IL
Distribution: Mandriva 2009.0 PowerPack x86_64
Posts: 150

Rep: Reputation: 15
Question problems compiling executable with gcj


I wrote a program in Java and it works great, but now I would like to compile it into native code in order for it to start up and run faster and not have to rely on a JVM to be installed. So, I compiled my program into object code, not a problem (gcj -c -O3 <nameOfJavaFile.java>). Then I combined packages into .dlls (gcj -shared -o <dllFile.dll> <objectFiles>). Now, I am trying to compile the main class into an executable and trying to link the .dlls to it. I run the following command: "gcj --main=Backup -o Backup.exe Backup.o -Lsr.dll ssa.dll sunio.dll logging.dll errorLogger.dll nstdexcptn.dll classLoader.dll dbutils.dll" and I get the following error:
/home/wslyhbb/tmp/ccch1XIC.o(.text+0x24): In function `main':
: undefined reference to `Backup::class$'
logging.dll: undefined reference to `sun::reflect::Reflection::getCallerClass(int)'
logging.dll: undefined reference to `java::util::logging::FileHandler::isSetUID()'
collect2: ld returned 1 exit status

Now, I do not understand why I get a undefined reference to my Backup class. Second, the whole sun.reflect.Reflection class I compiled into sr.dll (sun.reflect package), and the java.util.logging.FileHandler and all of the other java.util.logging classes are compiled into logging.dll, so again it cannot find itself or something. Can anyone tell me what I am doing wrong and how to fix it? It would be greatly appreciated if someone could help me. If there is any other information you would like, like any code I would be glad to post it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcj problems 'cannot find -lz' zeppelin147 Linux - Software 0 11-17-2005 11:13 AM
need help with gcj max_rsr Programming 1 05-24-2005 03:07 AM
Executable problems chansen0421 Linux - Newbie 2 07-21-2004 11:02 AM
compiling a java file to be executable spyghost Programming 5 08-28-2003 07:20 AM
gcc, gcj, and java problems weppnesp Linux - Software 0 06-15-2003 06:34 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration