This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: libgcj/2737: User-defined thrown exception is not found


I shouldn't even need the -I if I'm working in the same directory right?
Put all the files, InitializationException.java, LotNumber.java, and
Makefile, in the same directory, (which in my Makefile is SPATH) and try to
direct the output to OPATH.

Thanks,
Jeff Dahl

Here are my source files:
////////////////////////////////////////////////////////////////////////////
/
//  InitializationException.java
////////////////////////////////////////////////////////////////////////////
package test.core;
public class InitializationException extends Exception
{
    public InitializationException( )
    {
	super( "Invalid initial values" );
    }

    public InitializationException( String message )
    {
	super( message );
    }
}

////////////////////////////////////////////////////////////////////////////
/////
//  LotNumber.java
////////////////////////////////////////////////////////////////////////////
/////
package test.core;
import java.util.*;
public class LotNumber
{
    protected String travelerID;
    protected String travelerExt;

    public LotNumber( String lot ) throws InitializationException
    {
	try
	    {
		travelerID = lot.substring( 0, 7 ).toUpperCase( );
		if( lot.length( ) > 7 )
		    {
			travelerExt = lot.substring( 7 ).toUpperCase( );
		    }
		else 
		    {
			travelerExt = "";
		    }
	    }
	catch( IndexOutOfBoundsException ioobe )
	    {
		throw new InitializationException( "Invalid LotNumber: " +
lot );
	    }
    }
}

////////////////////////////////////////////////////////////////////////////
//////
//  MAKEFILE:
////////////////////////////////////////////////////////////////////////////
//////
# macro definitions
MAKE = /usr/ucb/gmake
GCJ = /usr/usr3/jddahl/jcc/bin/gcj
OBJECTS = /u/jddahl/java/objects_solaris
SOURCES = /u/jddahl/java/sources
OPATH = $(OBJECTS)/test/core
SPATH = $(SOURCES)/test/core

# program file
$(OPATH)/LotNumber.o:	$(SPATH)/InitializationException.java
$(SPATH)/LotNumber.java
	$(GCJ) --encoding=UTF-8 -o $(OPATH)/LotNumber.o
$(SPATH)/InitializationException.java $(SPATH)/LotNumber.java 

////////////////////////////////////////////////////////////////////////////
///////
//  ERROR FROM COMMAND LINE:
////////////////////////////////////////////////////////////////////////////
///////
gmake -f LotNumber.solaris.mak
/usr/usr3/jddahl/jcc/bin/gcj --encoding=UTF-8 -o
/u/jddahl/java/objects_solaris/test/core/LotNumber.o
/u/jddahl/java/sources/test/core/InitializationException.java
/u/jddahl/java/sources/test/core/LotNumber.java 
Undefined                       first referenced
 symbol                             in file
main
/usr/usr3/jddahl/jcc/lib/gcc-lib/sparc-sun-solaris2.6/3.0/crt1.o
ld: fatal: Symbol referencing errors. No output written to
/u/jddahl/java/objects_solaris/test/core/LotNumber.o
collect2: ld returned 1 exit status
gmake: *** [/u/jddahl/java/objects_solaris/test/core/LotNumber.o] Error 1


-----Original Message-----
From: Tom Tromey [mailto:tromey@redhat.com]
Sent: Wednesday, June 20, 2001 11:18 AM
To: jddahl
Cc: gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org; java-prs@gcc.gnu.org;
nobody@gcc.gnu.org
Subject: Re: libgcj/2737: User-defined thrown exception is not found


>>>>> "Jeff" == jddahl  <jddahl@micron.com> writes:

Jeff> I'm -I'ing the current directory which contains the exception.
Jeff> Why is class 'InitializationException' not found in 'throws'?
Jeff> InitializationException is in the same directory, not in
Jeff> 'throws'?  Obviously I'm missing something.  Thanks for your
Jeff> help.

Like I said in my reply, I tried several things to reproduce the bug.
In order to continue on, I'll need more information from you.

For instance, if you have a small, self-contained example that I could
download and then try here, that would be really helpful, especially
if it came with some instructions on how to reproduce the problem.

Hmm, you are doing this:

    /usr/usr3/jddahl/jcc/bin/gcj --encoding=UTF-8
    -I/u/jddahl/java/objects_solaris/test/core -MD -o
    /u/jddahl/java/objects_solaris/test/core/LotNumber.o
    /u/jddahl/java/sources/test/core/LotNumber.java

I think your `-I' is wrong.  You are pointing it at yur object
directory.  It ought to point to your source directory instead.

Could you verify this theory?

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]