Segfault with trivial SWT snippet

Carl Worth cworth@cworth.org
Wed Nov 14 16:46:00 GMT 2007


On Wed, 14 Nov 2007 09:02:26 -0500, "Harpal Grover" wrote:
> >   >      ccUlWBRV.i:(.text+0x2b): undefined reference to
> > `Snippet1::class$'
>
> Is your "Snippet1" class located inside of a package? If so you will have
> use "--main" flag as so: --main=packagename.Snippet1

That wasn't the bug in this particular case. But I appreciate you
pointing the problem out, because when I first started with this
Snippet1.java from the SWT website it did have a package statement and
I did have exactly that problem.

When I ran into that bug I was totally stumped until someone on IRC
helped me figure out the problem.

If someone could come up with a more helpful error message in this
case, that would be really appreciated.

Shouldn't the compiler be able to notice that when I pass
--main=Snippet1 that there's no such class? And then it could error
out with something like:

	Error: No class Snippet1 found for --main.
	(Perhaps Snippet1 exists in some.package.Snippet1 ?)

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java/attachments/20071114/e2c8c4f3/attachment.sig>


More information about the Java mailing list