LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Strange behaviour when trying to use MinGW-GCJ so as to make a native executable file from Java code (https://www.linuxquestions.org/questions/linux-general-1/strange-behaviour-when-trying-to-use-mingw-gcj-so-as-to-make-a-native-executable-file-from-java-code-4175562444/)

White_Cat 12-27-2015 08:54 AM

Strange behaviour when trying to use MinGW-GCJ so as to make a native executable file from Java code
 
Dear friends,

I am currently working on a 32-bit Slackware system and I have just
downloaded, built and installed MinGW Croos Compiler, because I would like
to be able to make native Windows executables from within my Linux environment.
The cross compiler works fine when I write C/C++ code, but as I am mainly
interested in Java, I use i386-mingw-gcj.
I have just made a simple hello_world.java file with the following code :

public class hello_world {
public final static void main(String[] arg) {
System.out.println("Hello World\n");
}
}

I am trying to compile it to a hello_world.exe with gcj by giving the following command :

i386-mingw32-gcj --main=hello_world hello_world.java

I get the error messages shown below. Could anyone possibly imagine what I may be doing wrong ?

/usr/share/mingw32/bin/../lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libgcj.a(win32.o): In function `_Z23win32_exception_handlerP19_EXCEPTION_POINTERS':
//tmp/SBo/x86-mingw32-build/mingw32/build-gcc/i386-mingw32/libjava/../../../gcc-3.4.5-20060117-2/libjava/win32.cc:25: multiple definition of `__CRT_MT'
/usr/share/mingw32/bin/../../mingw32/lib/libmingw32.a(crtst.o):crtst.c:(.bss+0x0): first defined here
collect2: ld returned 1 exit status

May the new year be more peaceful than this one for all the world,
Best regards to you all,

A humble white cat from Greece

P.S : I forgot to mention that the wishes are not part of the error messages :-))))))))


All times are GMT -5. The time now is 07:04 PM.