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.
|