M
Mary
Hello,
The problem I am having is when I try to generate a dll from the
RegConnect.c code. The RegConnect.c class contains the JNI calls as
well as the calls to the Win32 registry functions, such as
RegCloseKey, RegDeleteKey etc. I just want to build the dll for this
class, so I can call the functions from my Java class. The problem is
when I try to use the command line to generate the dll, I get the
errors, listed below.
I initially thought this was because windows.h was included in the
RegConnect.c file and it wasn't on my machine. So I downloaded the
Windows SDK. This still didn't solve the problem. I then thought it
was because I wasn't including advapi32.lib but I have listed that as
one of the includes (maybe this is not how i should be doing it??) but
it still doesn't work.
I am using java.1.4.1 on Windows XP.
The environment variables I am using are:
WINDOWS_INCLUDE: "C:\Program Files\Microsoft SDK\include"
JAVA_INCLUDE: C:\j2sdk1.4.1_01\include
advapi32.lib is in the C:\Program Files\Microsoft SDK\lib directory.
I have been searching all the newsgroups but cannot find an exact
replicate of the problem as most others who have this problem are
using MSVC++ and can just update their project settings!
Thanks in advance for any help on this!
Mary
C:\Projects\PCF\src>cl -I%WINDOWS_INCLUDE% -I"C:\Program
Files\Microsoft SDK\lib
" -I%JAVA_INCLUDE% -I%JAVA_INCLUDE%\win32 -LD RegConnect.c
-FeRegConnect.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
RegConnect.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/dll
/implib:RegConnect.lib
/out:RegConnect.dll
RegConnect.obj
Creating library RegConnect.lib and object RegConnect.exp
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegCloseKey@4
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegQueryValueE
xA@24
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegOpenKeyExA@
20
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegConnectRegi
stryA@12
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__wsprintfA
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegSetValueExA
@24
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegCreateKeyEx
A@36
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegDeleteKeyA@
8
RegConnect.dll : fatal error LNK1120: 8 unresolved externals
C:\Projects\PCF\src>
The problem I am having is when I try to generate a dll from the
RegConnect.c code. The RegConnect.c class contains the JNI calls as
well as the calls to the Win32 registry functions, such as
RegCloseKey, RegDeleteKey etc. I just want to build the dll for this
class, so I can call the functions from my Java class. The problem is
when I try to use the command line to generate the dll, I get the
errors, listed below.
I initially thought this was because windows.h was included in the
RegConnect.c file and it wasn't on my machine. So I downloaded the
Windows SDK. This still didn't solve the problem. I then thought it
was because I wasn't including advapi32.lib but I have listed that as
one of the includes (maybe this is not how i should be doing it??) but
it still doesn't work.
I am using java.1.4.1 on Windows XP.
The environment variables I am using are:
WINDOWS_INCLUDE: "C:\Program Files\Microsoft SDK\include"
JAVA_INCLUDE: C:\j2sdk1.4.1_01\include
advapi32.lib is in the C:\Program Files\Microsoft SDK\lib directory.
I have been searching all the newsgroups but cannot find an exact
replicate of the problem as most others who have this problem are
using MSVC++ and can just update their project settings!
Thanks in advance for any help on this!
Mary
C:\Projects\PCF\src>cl -I%WINDOWS_INCLUDE% -I"C:\Program
Files\Microsoft SDK\lib
" -I%JAVA_INCLUDE% -I%JAVA_INCLUDE%\win32 -LD RegConnect.c
-FeRegConnect.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
RegConnect.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.
/dll
/implib:RegConnect.lib
/out:RegConnect.dll
RegConnect.obj
Creating library RegConnect.lib and object RegConnect.exp
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegCloseKey@4
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegQueryValueE
xA@24
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegOpenKeyExA@
20
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegConnectRegi
stryA@12
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__wsprintfA
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegSetValueExA
@24
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegCreateKeyEx
A@36
RegConnect.obj : error LNK2001: unresolved external symbol
__imp__RegDeleteKeyA@
8
RegConnect.dll : fatal error LNK1120: 8 unresolved externals
C:\Projects\PCF\src>