Hello,
I'm trying to compile Christian Werner's Sqlite JDBC driver under WinXP using Platform SDK and VS2005. This process breaks with the follwing error message:
Microsoft (R) Program Maintenance Utility Version 8.00.50727.42 Copyright (C) Microsoft Corporation. All rights reserved.
cl -I. -Isqlite-3.3.5 -I"C:\Program Files\Microsoft Platform SDK\Include \crt" -DHAVE_SQLITE3=1 -Gs -GX -D_WIN32 -nologo native/fixup.c cl : Command line warning D9035 : option 'GX' has been deprecated and will be re moved in a future release cl : Command line warning D9036 : use 'EHsc' instead of 'GX'
fixup.c
LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'
NMAKE : fatal error U1077: '.\cl.EXE' : return code '0x2'
Stop.
Problem is that LIBCMT.lib (included due to the -D_MT Switch ) that doesn't exist in the Platform SDK folders. The library only exists in the 64bit subfolders (IA64, AM64).
Any ideas if the MT switch has been deprecated or where the library should be found Any better place to ask
Thanks a lot,
Andreas

LIBCMT.lib not found (LNK1104 error)
Lakshmana Kumar K
Hello Andreas,
It looks as if the compiler/linker cannot find the lib. Have you run vcvarsall.bat
Chris Wr
Looks like it's not part of the PSDK any longer. My copy was in : C:\Program Files\Microsoft Visual Studio 8\VC\lib though. But I presume you don't have VC++ 8 on this machine.
Xinirnix
Yes I have. I forgot to mention this- the file does NOT exist on my disk, although the Platform SDK has been installed. That's what's confusing me...
Ideas
Thanks,
Andi
Anonymice
This file belongs to the compiler setup and not to the platform SDK. Sure that this file is in the library section of the compiler
...\Microsoft Visual Studio 8\VC\lib
Xero2007
Microsoft Windows XP [Version 5.1.2600]
C:>javah -jni HalloWelt
produced no errors
C:>make_HalloWelt.bat
C:\....\HalloWelt>cl -Ic:\programme\java\jdk1.5.0\include -Ic:\p
rogramme\java\jdk1.5.0\include\win32 -LD HalloWelt.c -Fehallowelt.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
HalloWelt.c
C:\Programme\Java\jdk1.6.0_02\include\jni.h(21) : fatal error C1083: Cannot open
include file: 'stdio.h': No such file or directory
C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Beispiele Dirk Louis
Peter Muller\Kapitel39\HalloWelt>
I investigated the SET environvent variables
SET
INCLUDE=C:\Programme\Java\jdk1.6.0_02\include;C:\Programme\Java\jdk1.6.0_02\include\win32;C:\Programme\Microsoft Visual Studio 8\VC\include
and corrected it by using My Computer , properties.
The same way as the PATH is set.
again another error
C:\Programme\Java\jdk1.6.0_02\include\jni.h(27) : fatal error C1083: Cannot open
include file: 'jni_md.h': No such file or directory
I searched for the file and corrected my include path.
INCLUDE=C:\Programme\Java\jdk1.6.0_02\include;C:\Programme\Java\jdk1.6.0_02\incl
ude\win32;C:\Programme\Microsoft Visual Studio 8\VC\include
and again experienced a new error.
make_HalloWelt.bat
C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Beispiele Dirk Louis
Peter Muller\Kapitel39\HalloWelt>cl -Ic:\programme\java\jdk1.5.0\include -Ic:\p
rogramme\java\jdk1.5.0\include\win32 -LD HalloWelt.c -Fehallowelt.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
HalloWelt.c
Microsoft (R) Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
/dll
/implib:hallowelt.lib
/out:hallowelt.dll
HalloWelt.obj
LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib'
after a file search the file is present under
C:\Programme\Microsoft Visual Studio 8\VC\lib>dir libcmt.lib
Verzeichnis von C:\Programme\Microsoft Visual Studio 8\VC\lib
22.09.2005 22:47 7.716.360 libcmt.lib
1 Datei(en) 7.716.360 Bytes
0 Verzeichnis(se), 25.275.535.360 Bytes frei
The file is present.
Please what to do another INCLUDE option
I am using Microsoft visual studio 2005 Express edition,
Microsoft Visual Studio 2005
Version 8.0.50727.42 (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727
Installed Edition: VC Express
Microsoft Visual C++ 2005 76542-000-0000011-00125
Microsoft Visual C++ 2005
I know how to find, Tools, Options, projects and solutions,
VC++ Directories, show directories for
-> Include files
Path to use when searching for include files while building a VC++ project. Corresponds to environment variable INCLUDE.
Currently it looks like
$(VCInstallDir)include
$(VCInstallDir)PlatformSDK\include
$(FrameworkSDKDir)include
I did not modify this.
My question,
javac -version
javac 1.6.0_02
java -version
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)
javah -version
javah version "1.6.0_02"
Are there any known problems and known solutions
if I would prefer to use VC++ togeher with Java Native Interface and Suns JDK
This posting is about Visual Studio, Java Native Interface and Java Development kit,
but mostly about Path errors when the Visual studio cl.exe is invoked from command line.
My makefile looks like
cl -Ic:\programme\java\jdk1.5.0\include -Ic:\programme\java\jdk1.5.0\include\win32 -LD HalloWelt.c -Fehallowelt.dll
And it is a very basic JNI example taken from here
http://www.carpelibrum.de/home.html /buecher/java_komp/downloads.html
I can post a snip of the code, if that helps.
A general URL to how to use JNI and JDK with visual studio C++ would be useful.
Please.jjohn
This is interesting.
I attempt to use JNI Java Native Interface
and gets LINK : fatal error LNK1104: cannot open file 'LIBCMT.lib' when a java program attempts to invoke a c program.
I have set the paths but I will elaborate.
The missing file libcmt.lib is present.
If you know more about using suns javah -jni please inform.