Home » Eclipse Projects » Standard Widget Toolkit (SWT) » swt.lib ??
swt.lib ?? [message #446636] |
Tue, 30 November 2004 08:48  |
Eclipse User |
|
|
|
Originally posted by: camilla.orlandi.gmail.com
hi everybody
I have Eclipse 3.0, gcj & gcc 3.4 on windows 2K.
I tried to compile my swt class with gcj and works, but I can't manage to
link the file so I have not an exe at the end of the compilation. I have
<classname>.o, obviously.
the fact is that I need a swt.lib file to get the linking, I suppose, but
I can't find the way to get it.
I tried to compile the swt.jar from the prompt but had no success.
any idea??
|
|
|
Re: swt.lib ?? [message #446704 is a reply to message #446636] |
Tue, 30 November 2004 21:26   |
Eclipse User |
|
|
|
I've never used gcj, but I'll take a guess about the problem. Since SWT
has native code, you will need to link your executable with the library
that contains the native code. This is usually done by passing a .lib
file to the compiler. This file can be generated when the swt dll is
built (swt-win32-XXXX.dll). However, it is probably not distributed by
the SWT team, because normal users have no use for it.
That being said, I think you will have to try to rebuild the swt dll
yourself. The build might already generate a .lib for you. If not, you
will have to modify the linker options yourself to generate it.
Charlie
Camilla wrote:
> hi everybody
> I have Eclipse 3.0, gcj & gcc 3.4 on windows 2K.
> I tried to compile my swt class with gcj and works, but I can't manage
> to link the file so I have not an exe at the end of the compilation. I
> have <classname>.o, obviously.
> the fact is that I need a swt.lib file to get the linking, I suppose,
> but I can't find the way to get it.
> I tried to compile the swt.jar from the prompt but had no success.
> any idea??
>
|
|
|
Re: swt.lib ?? [message #446705 is a reply to message #446704] |
Tue, 30 November 2004 22:20   |
Eclipse User |
|
|
|
After poking around the gcj site a bit, I think my comment may have been
incorrect. It looks like you can place the JNI library on the command
line for linking. You were probably asking about how to compile all of
the SWT java files. Can't help you there.
Sorry for any confusion :)
Charlie
Charlie Surface wrote:
> I've never used gcj, but I'll take a guess about the problem. Since SWT
> has native code, you will need to link your executable with the library
> that contains the native code. This is usually done by passing a .lib
> file to the compiler. This file can be generated when the swt dll is
> built (swt-win32-XXXX.dll). However, it is probably not distributed by
> the SWT team, because normal users have no use for it.
>
> That being said, I think you will have to try to rebuild the swt dll
> yourself. The build might already generate a .lib for you. If not, you
> will have to modify the linker options yourself to generate it.
>
> Charlie
>
>
> Camilla wrote:
>
>> hi everybody
>> I have Eclipse 3.0, gcj & gcc 3.4 on windows 2K.
>> I tried to compile my swt class with gcj and works, but I can't manage
>> to link the file so I have not an exe at the end of the compilation. I
>> have <classname>.o, obviously.
>> the fact is that I need a swt.lib file to get the linking, I suppose,
>> but I can't find the way to get it.
>> I tried to compile the swt.jar from the prompt but had no success.
>> any idea??
>>
|
|
| | | |
Re: swt.lib ?? [message #446714 is a reply to message #446712] |
Wed, 01 December 2004 08:20   |
Eclipse User |
|
|
|
melko writes:
> I dont understand what you mean, but if you make an EXE out of your JAVA
> files with this gcj-compiler you need no extra DLLs or JAVA runtime
> installed or something else. What you need is only one DLL that should
> be with the EXE together and it is the "swt-win32-3063.dll" !! So your
> Program consists only of an EXE-File and a single DLL?!?
> Nice day.
What I need - just EXE-file, without even this single DLL.
When user clicks on application via Intranet, I can not pass two
files, only one (EXE).
I know about GCJ can use it to create EXE, but it still requires SWT DLL.
>
> Konstantin Scheglov wrote:
>
>> melko <melko@gmx.at> wrote:
>
>
>> BTW, do you know, how to link SWT DLL directly in EXE ?
>> I need to have single EXE, without additional DLL's.
>> And I am afraid that this is impossible. :-(
>
>
>>> try this:
>
>
>>> make an build.bat with the following code and then it should make an
>>> exe out of your java files easily.
>
>
>>> @echo off
>
>
>>> SETLOCAL
>
>
>>> echo Name of the Main-Class...
>>> set MAIN=Main
>
>
>>> echo set the evironment-paths...
>>> PATH C:gccbin;C:gcci686-pc-mingw32bin;%PATH%
>>> set SWT_DIR=C:gccswt
>>>
>>>>>> in this SWT_DIR you have the *.dll of SWT and the swt.jar
>
>
>>> echo making dir...
>>> if exist bin rmdir /S /Q bin
>>> if exist obj rmdir /S /Q obj
>>> if exist include rmdir /S /Q include
>>> mkdir bin
>>> cd bin
>>> mkdir resources
>>> cd ..
>>> mkdir obj
>>> mkdir include
>
>
>>> echo Compiling to JAVA-Bytecode...
>>> gcj -C -fCLASSPATH=bin;src -g0 -Os -d bin srccomtestgui*.java
>>> gcj -C -fCLASSPATH=bin;src -g0 -Os -d bin srccomtestguidialog*.java
>>> gcj -C -fCLASSPATH=bin;src -g0 -Os -d bin srccomtestguifunctions*.java
>
>
>>>>>> here you set the path of your java files?! So it is your workspace!
>
>
>>> echo make an *.jar archive...
>>> xcopy /Q srcresources*.* .binresources >>>copy the ressources, if you
>>> have
>>> cd bin
>>> jar cf %MAIN%.jar .comtestgui*.class .comtestguidialog*.class
>>> comtestguifunctions*.class .resources*.*
>>> move %MAIN%.jar ..include
>>> cd ..
>
>
>>> echo make an object...
>>> gcj --classpath=obj;bin;%SWT_DIR%swt.jar -fjni -g0 -Os -c
>>> include%MAIN%.jar -o obj%MAIN%.o
>>>
>>>>>> here you set the swt.jar into the exe plus the now generated main.jar
>
>
>>> echo makes library...
>>> cd obj
>>> ar -crs lib%MAIN%.a *.o
>>> move lib%MAIN%.a ..include
>>> cd ..
>
>
>>> echo compiling the EXE-File...
>>> gcj -mwindows --main=com.test.gui.%MAIN% -fjni -g0 -Os -s -o
>>> %MAIN%.exe obj*.o include*.a -L%SWT_DIR% -lswt
>
>
>>> echo give a name to the EXE...
>>> if exist Test.exe del Test.exe
>>> ren %MAIN%.exe Test.exe
>
>
>>> echo.
>>> echo Finished!
>>> ENDLOCAL
>>> pause
>
>
>>> I hope I could help!
>
>
>>> nice greatings from austria.
>
>
>>> PS: You should delete in the source code the text that I have added with
>>>
>>>>>> starting!!! Thanks
>
>
>
>
>
>
|
|
| | | | | |
Re: swt.lib ?? [message #446805 is a reply to message #446749] |
Thu, 02 December 2004 10:37  |
Eclipse User |
|
|
|
Way back in the bad old DOS days, all you needed was a single .EXE. Then we
advanced to .DLL's, .INI's etc. Now we are back to a single .EXE. That's
funny.
"Radu Racariu" <rracaru@k.ro> wrote in message
news:comrmu$b0h$1@www.eclipse.org...
> check this out
> http://www.molebox.com/
> it should do what you need.
> cheers,
> radu
>
>
> Camilla wrote:
> > hi everybody
> > I have Eclipse 3.0, gcj & gcc 3.4 on windows 2K.
> > I tried to compile my swt class with gcj and works, but I can't manage
> > to link the file so I have not an exe at the end of the compilation. I
> > have <classname>.o, obviously.
> > the fact is that I need a swt.lib file to get the linking, I suppose,
> > but I can't find the way to get it.
> > I tried to compile the swt.jar from the prompt but had no success.
> > any idea??
> >
|
|
|
Goto Forum:
Current Time: Wed Jul 23 14:28:35 EDT 2025
Powered by FUDForum. Page generated in 0.07810 seconds
|