Help needed with link error [message #691914] |
Sat, 02 July 2011 15:33  |
Eclipse User |
|
|
|
I followed all the instructions in the HelloWorldSWT tutorial and I keep getting a link error. Here is what I get when I run the application:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-win32-3735 in java.library.path
no swt-win32 in java.library.path
Can't load library: C:\Users\Mark\.swt\lib\win32\x86\swt-win32-3735.dll
Can't load library: C:\Users\Mark\.swt\lib\win32\x86\swt-win32.dll
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194)
at org.eclipse.swt.internal.C.<clinit>(C.java:21)
at org.eclipse.swt.widgets.Display.<clinit>(Display.java:138)
at HelloWorldSWT.main(HelloWorldSWT.java:12)
I've tried all sorts of things to no avail (even moving my workspace, which didn't help). Any ideas?
Thanks!
Mark
|
|
|
|
|
|
|
Re: Help needed with link error [message #694125 is a reply to message #693009] |
Thu, 07 July 2011 17:26   |
Eclipse User |
|
|
|
I have the same problem as the OP, except I'm on Linux not Windows. Did the -D thing, no change. A clue might be that when the java source compiles, I get a warning:
Quote:
Build path specifies execution environment CDC-1.0/Foundation-1.0. There are no JREs installed in the workspace that are strictly compatible with this environment. org.eclipse.swt.gtk.linux.x86_64 Build path JRE System Library Problem
Another clue, or maybe irrelevant, is when I try "java HelloWorldSWT" at the command line, I get:
Quote:
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/swt/widgets/Display at HiMarsSwt.main(HiMarsSwt.java:12)
(note: i called my latest attempt "HiMarsSwt" not "HelloWorldSWT")
One notion in my software-experienced but java-naive mind is that somehow SWT isn't installed, that it needs to be installed separately from the jdk. Guessing that if SWT truly exists, there'd be a file, probably many, with "swt" in their names, I tried:
dwilson ~ ===> cd SW/SDK/jdk1.6.0_26
dwilson ~/SW/SDK/jdk1.6.0_26 ===> find . -iname '*swt*'
dwilson ~/SW/SDK/jdk1.6.0_26 ===>
(To be clear, that means no files found.)
Eclipse's directory does show about a dozen files, including one mentioned in the link error, libswt-gtk-3735.so (The OP has Windows, I'm on Linux, aside from that it's the same file) Maybe some path somewhere needs to be fixed?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07954 seconds