gcj compilation problem: 'undefined reference to org::eclipse::swt::events:...'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Has anyone had any luck compiling the eclipse examples using gcj? 
I have been trying for a month to compile the java examples that came
 with Eclipse using MingW gcc 3.3 on Windows.

My directory tree looks like this:
C:\Yello\Compiler\gcc-3.3\bin\*
C:\Yello\Compiler\swt\win32\lib\*
C:\Yello\Compiler\swt\win32\swt-2133\*

So, I copied the java files for the layoutexample
(org\eclipse\swt\examples\layoutexample\) 
to the directory I'm using for compilation, C:\Yello.
I have the following files in C:\Yello 
   -swt-win32-2133.dll is in the compilation directory and also in
System32
   -Tab.java 
   -RowLayoutTab.java 
   -LayoutExample.java 
   -GridLayoutTab.java 
   -FormLayoutTab.java 
   -FillLayoutTab.java
   -compile.bat

My batch file consists of
------------------------------------
setlocal
set PROG=LayoutExample

set SWT_BASE_DIR=C:\Yello\Compiler\swt\win32
set SWT_GCJ_LIB_DIR=C:\Yello\Compiler\swt\win32\lib
set SWT_JAVA_LIB_DIR=C:\Yello\Compiler\swt\win32\swt-2133

C:\Yello\Compiler\gcc-3.3\bin\gcj --main=%PROG%
--classpath=%SWT_JAVA_LIB_DIR%\swt.jar -s -o %PROG%.exe %PROG%.java
Tab.java RowLayoutTab.java GridLayoutTab.java FormLayoutTab.java
FillLayoutTab.java %SWT_GCJ_LIB_DIR%\SWTMessages.o
%SWT_GCJ_LIB_DIR%\SWTImageLoaders.o -L%SWT_GCJ_LIB_DIR% -lswt -mwindows
endlocal
-------------------------------------

>>>I run the batch file and get this output:
-------------------------------------
C:\Yello>setlocal

C:\Yello>set PROG=LayoutExample 

C:\Yello>set SWT_BASE_DIR=C:\Yello\Compiler\swt\win32 

C:\Yello>set SWT_GCJ_LIB_DIR=C:\Yello\Compiler\swt\win32\lib 

C:\Yello>set SWT_JAVA_LIB_DIR=C:\Yello\Compiler\swt\win32\swt-2133 

C:\Yello>C:\Yello\Compiler\gcc-3.3\bin\gcj --main=LayoutExample
--classpath=C:\Yello\Compiler\swt\win32\swt-2133\swt.jar -s -o
LayoutExample.exe LayoutExample.java Tab.java RowLayoutTab.java
GridLayoutTab.java FormLayoutTab.java FillLayoutTab.java
C:\Yello\Compiler\swt\win32\lib\SWTMessages.o
C:\Yello\Compiler\swt\win32\lib\SWTImageLoaders.o
-LC:\Yello\Compiler\swt\win32\lib -lswt -mwindows 
C:\DOCUME~1\a\LOCALS~1\Temp/ccE1baaa.o(.text+0x39): In function `main':
C:/DOCUME~1/a/LOCALS~1/Temp/ccyEbaaa.i: undefined reference to
`LayoutExample::class$'
C:\DOCUME~1\a\LOCALS~1\Temp/ccshbaaa.o(.text+0x56): In function
`org.eclipse.swt.examples.layoutexample.FillLayoutTab$2':
C:/DOCUME~1/a/LOCALS~1/Temp/ccgxaaaajx:1: undefined reference to
`org::eclipse::swt::events::SelectionAdapter::SelectionAdapter()'
C:\DOCUME~1\a\LOCALS~1\Temp/ccshbaaa.o(.text+0x6d): In function
`ZN3org7eclipse3swt8examples13layoutexample15FillLayoutTab$214widgetSelectedEPNS1_6events14SelectionEventE':
C:/Yello/FillLayoutTab.java:67: undefined reference to
`org::eclipse::swt::widgets::TableItem::class$'

... 800 more lines of "undefined reference"...
C:\Yello>endlocal
-------------------------------------
I have not modified the example files. All of gcc 3.3 and SWT are
downloaded 
pre-compiled, they were not compiled by me. I can compile programs that
consist of multiple java files 
but do not use SWT, and can also compile programs that use SWT but only
consist of one class, 
but can't compile multiple files that use SWT.

I have searched gcc-help mailing list archives and google but could not
find a solution. 
Any suggestions, links to websites, or to mail archives would be
helpful.

Regards,
Adam

__________________________________
Do you Yahoo!?
Find out what made the Top Yahoo! Searches of 2003
http://search.yahoo.com/top2003

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux