Thread: [tcljava-user] TclBlend build problems using MSYS on WinNT
Brought to you by:
mdejong
|
From: <rja...@nm...> - 2003-04-08 18:45:20
|
On a WINNT box,
Using MSYS, I built tcl8.4.2, tk8.4.2, and threads-2.5.1.
I installed JDK 1.3.1_07 in C:/jdk1.3.1_07 and added
<jdk>/bin, <jdk>/jre/bin, and <jdk>/jre/bin/classic to my
PATH.
So far, so good.
BUT...
./configure --prefix=C:/TclBlend --with-tcl=C:/TclBlend/tcl8.4.2/win
--with-thread=C:/TclBlend/thread-2.5/win --with-jdk=C:/jdk1.3.1_07
died with:
configure:4517: checking to see if we can link a JNI application
configure:4552: gcc -o conftest.exe -g -O2 -I/c/jdk1.3.1_07/include
-I/c/jdk1.3.1_07/include/win32 conftest.c /c/jdk1.3.1_07/lib/jvm.lib >&5
C:\TEMP/ccinaaaa.o: In function `main':
c:/TclBlend/tclBlend1.3.0/configure:4547: undefined reference to
`_imp__JNI_GetCreatedJavaVMs@12'
configure:4555: $? = 1
configure: failed program was:
| #line 4533 "configure"
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
|
| #include <jni.h>
|
| int
| main ()
| {
| JNI_GetCreatedJavaVMs(NULL,0,NULL);
| ;
| return 0;
| }
configure:4570: error: could not link file that includes jni.h
Either the configure script does not know how to deal with
this JVM configuration or the JVM install is broken or corrupted.
Is there some more magic I need to do with my PATH or other environment
variables?
Any suggestions are appreciated.
Bob Jackson
|
|
From: Mo D. <md...@un...> - 2003-04-08 20:04:54
|
On Tue, 08 Apr 2003 12:47:00 -0600 rja...@nm... (Robert E. Jackson) wrote: > On a WINNT box, > > Using MSYS, I built tcl8.4.2, tk8.4.2, and threads-2.5.1. > > I installed JDK 1.3.1_07 in C:/jdk1.3.1_07 and added > <jdk>/bin, <jdk>/jre/bin, and <jdk>/jre/bin/classic to my > PATH. You should not need to set your PATH before running ./configure, but that does not seem to have anything to do with the error you are getting. > configure:4517: checking to see if we can link a JNI application > configure:4552: gcc -o conftest.exe -g -O2 -I/c/jdk1.3.1_07/include > -I/c/jdk1.3.1_07/include/win32 conftest.c /c/jdk1.3.1_07/lib/jvm.lib >&5 > C:\TEMP/ccinaaaa.o: In function `main': > > c:/TclBlend/tclBlend1.3.0/configure:4547: undefined reference to > `_imp__JNI_GetCreatedJavaVMs@12' ... > Is there some more magic I need to do with my PATH or other environment > variables? No, that should have worked. Could you run `ls -la /c/jdk1.3.1_07/lib/jvm.lib` just to make sure that the lib file is there and then run `nm /c/jdk1.3.1_07/lib/jvm.lib | grep JNI_` and post the results? Something is going wrong while linking, but I am not sure what it could be. The jni.h header is getting read correctly, since it is searching for the dll import symbol '_imp__JNI_GetCreatedJavaVMs@12', the problem is that this symbol does not seem to be found in the lib file. cheers Mo |
|
From: <rja...@nm...> - 2003-04-08 21:28:20
|
ls -la /c/jdk1.3.1_07/lib/jvm.lib -> -rw-r--r-- 1 jidrej Administ 50692 Dec 11 14:49 /c/jdk1.3.1_07/lib/jvm.lib nm /c/jdk1.3.1_07/lib/jvm.lib | grep JNI_ -> 00000000 I __imp__JNI_CreateJavaVM 00000000 T _JNI_CreateJavaVM 00000000 I __imp__JNI_GetCreatedJavaVMs 00000000 T _JNI_GetCreatedJavaVMs 00000000 I __imp__JNI_GetDefaultJavaVMInitArgs 00000000 T _JNI_GetDefaultJavaVMInitArgs In the jvm.lib file I did notice _JNI_GetCreatedJavaVMs near jvm.dll But jvm.dll is <jvm>/jre/bin/classic which is in the PATH but nowhere in the configure data. PATH=.:/cygdrive/c/msys/local/bin:/cygdrive/c/msys/mingw/bin:/cygdrive/c/msys/bin:/cygdrive/c/jdk1.3.1_07/bin:/cygdrive/c/jdk1.3.1_07/jre/bin:/cygdrive/c/jdk1.3.1_07/jre/bin/classic:/cygdrive/c/PROGRA~1/CVSFOR~1:/usr/bin:/cygdrive/c/WINNT/system32:/cygdrive/c/WINNT:/cygdrive/c/DMI/bin:/cygdrive/c/WINNT/system32/nls/ENGLISH:/cygdrive/c/WINNT/system32/nls:.:/cygdrive/c/Program Files/rksupport:/cygdrive/c/INFORMIX/bin:/cygdrive/c/jam7/util:/cygdrive/c/Program Files/SSH Communications Security/SSH Secure Shell Is cygwin messing up the path??? Bob Mo DeJong wrote: > On Tue, 08 Apr 2003 12:47:00 -0600 > rja...@nm... (Robert E. Jackson) wrote: > > >>On a WINNT box, >> >>Using MSYS, I built tcl8.4.2, tk8.4.2, and threads-2.5.1. >> >>I installed JDK 1.3.1_07 in C:/jdk1.3.1_07 and added >><jdk>/bin, <jdk>/jre/bin, and <jdk>/jre/bin/classic to my >>PATH. > > > You should not need to set your PATH before running ./configure, > but that does not seem to have anything to do with the error > you are getting. > > >>configure:4517: checking to see if we can link a JNI application >>configure:4552: gcc -o conftest.exe -g -O2 -I/c/jdk1.3.1_07/include >>-I/c/jdk1.3.1_07/include/win32 conftest.c /c/jdk1.3.1_07/lib/jvm.lib >&5 >>C:\TEMP/ccinaaaa.o: In function `main': >> >>c:/TclBlend/tclBlend1.3.0/configure:4547: undefined reference to >>`_imp__JNI_GetCreatedJavaVMs@12' > > > ... > > >>Is there some more magic I need to do with my PATH or other environment >>variables? > > > No, that should have worked. Could you run `ls -la /c/jdk1.3.1_07/lib/jvm.lib` > just to make sure that the lib file is there and then run `nm /c/jdk1.3.1_07/lib/jvm.lib | grep JNI_` > and post the results? Something is going wrong while linking, but I am not sure what > it could be. The jni.h header is getting read correctly, since it is searching for the > dll import symbol '_imp__JNI_GetCreatedJavaVMs@12', the problem is that this > symbol does not seem to be found in the lib file. > > cheers > Mo > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > |
|
From: Mo D. <md...@un...> - 2003-04-08 23:35:15
|
On Tue, 08 Apr 2003 15:29:53 -0600 rja...@nm... (Robert E. Jackson) wrote: > nm /c/jdk1.3.1_07/lib/jvm.lib | grep JNI_ -> > 00000000 I __imp__JNI_CreateJavaVM > 00000000 T _JNI_CreateJavaVM > 00000000 I __imp__JNI_GetCreatedJavaVMs > 00000000 T _JNI_GetCreatedJavaVMs > 00000000 I __imp__JNI_GetDefaultJavaVMInitArgs > 00000000 T _JNI_GetDefaultJavaVMInitArgs > > In the jvm.lib file I did notice > > _JNI_GetCreatedJavaVMs near jvm.dll > > But jvm.dll is <jvm>/jre/bin/classic which is in the PATH > but nowhere in the configure data. So, I don't see anything that is obviously wrong here. The .lib file should tell the runtime linker to pull in jvm.dll at runtime, but that has nothing to do with this problem. I remember reading this page about linking problems with gcc and JNI: http://www.inonit.com/cygwin/jni/invocationApi/archive.html Could you try downloading this .a file and trying to link with it instead of the JVM supplied jvm.lib? I thought gcc could handle this without special hand holding, but perhaps this is the problem. http://www.inonit.com/cygwin/jni/invocationApi/libjvm.dll.a Just create a .c file like the configure script does and then try to link it using the same command line args: % cat jni.c #include <jni.h> int main () { JNI_GetCreatedJavaVMs(NULL,0,NULL); return 0; } % cc -o jni.exe -g -O2 -I/c/jdk1.3.1_07/include -I/c/jdk1.3.1_07/include/win32 \ jni.c /c/jdk1.3.1_07/lib/jvm.lib And then try it with -L. -ljvm instead of the jvm.lib path after saving the libjvm.dll.a in the build dir. > Is cygwin messing up the path??? This has nothing to do with Cygwin. I don't think it is a path issue either. It is a compiler issue. Say, what was the URL for the JDK that you downloaded? I might be able to reproduce the error if on my system if I use the same JDK you used. Mo |
|
From: <rja...@nm...> - 2003-04-16 21:02:08
|
That was it. Downloaded libjvm.dll.a Did: LDFLAGS="-L. -ljvm" ./configure ... and configure ran OK. Diddled JAVA_LIB_FLAGS in Makefile to match LDFLAGS and make ran OK. However having problems with 'make check'. Dies at # Making test_tclblend.build in ... javac-g -d /c/TclBlend/tclBlend1.3.0/btests tests/*.java tcl/land/*.java What signs should I look for now? Bob Mo DeJong wrote: > On Tue, 08 Apr 2003 15:29:53 -0600 > rja...@nm... (Robert E. Jackson) wrote: > > >>nm /c/jdk1.3.1_07/lib/jvm.lib | grep JNI_ -> >>00000000 I __imp__JNI_CreateJavaVM >>00000000 T _JNI_CreateJavaVM >>00000000 I __imp__JNI_GetCreatedJavaVMs >>00000000 T _JNI_GetCreatedJavaVMs >>00000000 I __imp__JNI_GetDefaultJavaVMInitArgs >>00000000 T _JNI_GetDefaultJavaVMInitArgs >> >>In the jvm.lib file I did notice >> >>_JNI_GetCreatedJavaVMs near jvm.dll >> >>But jvm.dll is <jvm>/jre/bin/classic which is in the PATH >>but nowhere in the configure data. > > > So, I don't see anything that is obviously wrong here. The .lib > file should tell the runtime linker to pull in jvm.dll at runtime, > but that has nothing to do with this problem. > > I remember reading this page about linking problems with > gcc and JNI: > > http://www.inonit.com/cygwin/jni/invocationApi/archive.html > > Could you try downloading this .a file and trying to link with > it instead of the JVM supplied jvm.lib? I thought gcc could > handle this without special hand holding, but perhaps this > is the problem. > > http://www.inonit.com/cygwin/jni/invocationApi/libjvm.dll.a > > Just create a .c file like the configure script does and then try to > link it using the same command line args: > > % cat jni.c > #include <jni.h> > int main () { JNI_GetCreatedJavaVMs(NULL,0,NULL); return 0; } > > % cc -o jni.exe -g -O2 -I/c/jdk1.3.1_07/include -I/c/jdk1.3.1_07/include/win32 \ > jni.c /c/jdk1.3.1_07/lib/jvm.lib > > And then try it with -L. -ljvm instead of the jvm.lib path after saving the libjvm.dll.a > in the build dir. > > >>Is cygwin messing up the path??? > > > This has nothing to do with Cygwin. I don't think it is a path issue > either. It is a compiler issue. Say, what was the URL for the JDK > that you downloaded? I might be able to reproduce the error if > on my system if I use the same JDK you used. > > Mo > > > ------------------------------------------------------- > This SF.net email is sponsored by: ValueWeb: > Dedicated Hosting for just $79/mo with 500 GB of bandwidth! > No other company gives more support or power for your dedicated server > http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/ > _______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > |
|
From: Mo D. <md...@un...> - 2003-04-19 00:37:27
|
On Wed, 16 Apr 2003 15:04:13 -0600 rja...@nm... (Robert E. Jackson) wrote: > That was it. > > Downloaded libjvm.dll.a > > Did: > > LDFLAGS="-L. -ljvm" ./configure ... > > and configure ran OK. Ok, I will have to put that on my TODO list. If you could post a link to the location where you download this JVM from, it would help. > Dies at # Making test_tclblend.build > in > ... javac-g -d /c/TclBlend/tclBlend1.3.0/btests tests/*.java tcl/land/*.java You need to post the actual error that is printed by the compiler. Is is not finding the .jar files? Is the btests dir not there? Is the problem with the java compiler, does it not understand / in the file names under Windows? What exactly is going wrong? Mo |
|
From: Mo D. <md...@un...> - 2003-07-07 18:52:40
|
On Tue, 8 Apr 2003 16:38:28 -0700 Mo DeJong <md...@un...> wrote: > So, I don't see anything that is obviously wrong here. The .lib > file should tell the runtime linker to pull in jvm.dll at runtime, > but that has nothing to do with this problem. > > I remember reading this page about linking problems with > gcc and JNI: > > http://www.inonit.com/cygwin/jni/invocationApi/archive.html Just an FYI here, I ended up adding an import lib to the CVS and adding a check to the configure script so that if linking with jvm.lib fails, the custom import lib will be used. You can either grab the CVS version to get this update or wait until the next release. cheers Mo DeJong |