undefined reference ?

Prashanth K.S. elxrgh!pks at elxsi.ernet.in
Mon Jan 11 16:19:32 PST 1999


Hello everybody,

   i'm new to kaffe and this mailing list, so kindly bear with me...

I'm still using kaffe 1.0b2 (beta 2) version. I built it successfully on 
windows-x86 using cygwin32 tools (beta 19). My problem is :

  i wrote my version of "findInJar" which doesn't make call to functions 
"openJarFile", "getDataJarFile", "closeJarFile" defined in "jar.c" . But  
libraries/clib/native/ZipFile.c still uses these functions.
I control the compilation of "myfindInJar" or existing "findInJar" using 
something like...

 #ifdef JARFIND
 ....  (existing findInJar() definition or declaration etc)
 ....
 #elif defined(MYFIND)
 ....  (myfindInJar() definition or declaration etc)
 .... 
 #else
 #error "blah blah.."
 #endif

 I have made changes at all places referring to "findInJar()" 
for ex: in "libraries/clib/native/ClassLoader.c"...

 The compilation goes through but i get "undefined reference ..." error 
during linking as shown below :

--------
gcc -g -O2 -Wall -Wstrict-prototypes  -I. -I./../kaffevm -I../../config 
-I./../../config -I../../include -I./../../include   -o Kaffe.exe main.o 
../kaffevm/libkaffevm.a  ../../libraries/clib/native/libnative.a 
../../libraries/clib/net/libnet.a ../../libraries/clib/zip/libzip.a 
../../libraries/clib/math/libmath.a ../../libraries/clib/management
/libmanagement.a  -lm 

../../libraries/clib/native/libnative.a(ZipFile.o): In function 
`java_util_zip_ZipFile_openZipFile0':
/kaffe/src/kaffe-1.0.b2/libraries/clib/native/ZipFile.c:31: undefined 
reference to `openJarFile'
        |
        +--------------->>>> Error   
              
../../libraries/clib/native/libnative.a(ZipFile.o): In function 
`java_util_zip_ZipFile_closeZipFile0':
/kaffe/src/kaffe-1.0.b2/libraries/clib/native/ZipFile.c:39: undefined 
reference to `closeJarFile'
       |
       +----------------->>>> Error

etc...
----------

Note : After playing around for some time i've found that : 
 if i add a dummy call to say "openJarFile(...)" in 
 "myfindInJar()" function, linking also goes through and i get the exe.

   Any idea as to whatz happening ? Am i doing something wrong ??

please help...

TIA,
prashanth




More information about the kaffe mailing list