This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


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

Re: Newbie : How to compile



Martín Pérez  Mariñán writes:

> When I try to compile this file, it seems that it doesn't find the
> NoTerminal.o and Simbolo.o files.

It's actually looking for the Java files themselves. Make sure the
compiler knows where to look for source files. For example, I could
reproduce an error similar to the one you saw by doing:

  apbianco@venonat[~/tmp/O]: cat ../B.java 
  class B {A foo(){return null;}}
  apbianco@venonat[~/tmp/O]: cat ../A.java 
  class A {}
  apbianco@venonat[~/tmp/O]: gcj -c ../A.java 
  apbianco@venonat[~/tmp/O]: gcj -c ../B.java 
  ../B.java:1: Type `A' not found in the declaration of the return type of method `foo'.
     class B {A foo(){return null;}}
              ^
  1 error
  apbianco@venonat[~/tmp/O]: CLASSPATH="/home/apbianco/tmp" gcj -c ../B.java 

As you can see, setting CLASSPATH properly fixes my problem.

./A


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