LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-27-2015, 08:54 AM   #1
White_Cat
LQ Newbie
 
Registered: Dec 2015
Location: Athens - Greece
Distribution: I have used both Slackware 14.1 & Ubuntu 15.04
Posts: 2

Rep: Reputation: Disabled
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 :-))))))))
 
  


Reply

Tags
cross-compile, java, slackware



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to make single executable of my java app in linux rohaanembedded Programming 2 06-28-2013 12:07 AM
Compile to Native MinGW Zssfssz Programming 6 11-22-2011 10:01 PM
Strange Fontconfig File Behaviour Toods Slackware 2 01-15-2009 01:39 PM
Synaptic Package Manager shows 'java-common' and 'java-gcj-compat' as Installed. swiadek Ubuntu 3 02-12-2006 11:54 AM
problems compiling executable with gcj wslyhbb Programming 0 12-19-2003 09:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:33 PM.

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