[xmlsec] winxp compiling/linking dll
Timothy Jeffcoat
timcoat at yahoo.com
Wed May 31 16:44:48 PDT 2006
Hi
I have taken the source code for the xmlsec.exe that
comes with the xmlsec1-1.2.9 sourcecode download and
modified it to be recompiled into a dll. I am using
the C compiler that comes with the Microsoft XP DDK.
This is done to be compatible with the binaries
downloaded for windows from
http://www.zlatkovic.com/libxml.en.html . When I do a
nmake I am able to compile and get the obj files.
However, when attempting to do a build on my source
files I get a long list of errors complaining about
not being able to link correctly. The error lines are
some what like the one listed here:
crypto.obj : error LNK2019: unresolved external symbol
__imp__xmlSecMSCryptoInit at 0 referenced in function
_xmlSecAppCryptoInit at 4
xmlsecfunctions.obj : error LNK2019: unresolved
external symbol __imp__xmlSecDSigCtxDebugXmlDump at 8
referenced in function _xmlSecAppPrintDSigCtx at 4
Trying to get the libs to link correctly seems to be
the problem. I wonder if anybody can point me in the
correct direction on how to make sure that my setup is
done correctly? I am able to compile but why doesn't
the linking work correctly? Any Ideas? Am I doing
anything wrong in my sources file?
I have been able to create a MSVC++6.0 dll project and
get it to compile and link properly,but as mentioned
in other posts in this mailing list, problems arises
when trying to access it with the first I/O. The dll
crashes with first I/O attempt. So, that is why I am
attempting to recreate with the Win XP DDK C Compiler.
I have copied my sources file content here so that
anybody can help me.
Thanks in advance for any help.
tj
***** sources file *****
# Copyright (c) 1990-2003 Microsoft Corporation
# All Rights Reserved
TARGETNAME=xmlsecnjni
TARGETPATH=obj
TARGETTYPE=DYNLINK
TARGETEXT=dll
DLLENTRY=_DllMainCRTStartup
USE_MSVCRT=1
TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\gdi32.lib \
$(SDK_LIB_PATH)\winspool.lib \
$(SDK_LIB_PATH)\comdlg32.lib \
$(SDK_LIB_PATH)\advapi32.lib \
$(SDK_LIB_PATH)\shell32.lib \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\crypt32.lib \
$(SDK_LIB_PATH)\wininet.lib \
$(SDK_LIB_PATH)\Cryptnet.lib \
$(SDK_LIB_PATH)\zdll.lib \
$(SDK_LIB_PATH)\iconv.lib \
$(SDK_LIB_PATH)\libxml2.lib \
$(SDK_LIB_PATH)\libxslt.lib \
$(SDK_LIB_PATH)\libxmlsec.lib \
$(SDK_LIB_PATH)\libxmlsec-mscrypto.lib
C_DEFINES=/nologo /MD /W3 /GX /O2 /DWIN32 /DNDEBUG
/D_WINDOWS /D_UNICODE /DXMLSECNJNI_EXPORTS
INCLUDES= .; \
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\ICONV-1.9.2.WIN32\INCLUDE;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXML2-2.6.24.WIN32\INCLUDE;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXML2-2.6.24.WIN32\INCLUDE\LIBXML;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXMLSEC-1.2.9-2.WIN32\LIBXMLSEC-1.2.9.WIN32\INCLUDE;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXMLSEC-1.2.9-2.WIN32\LIBXMLSEC-1.2.9.WIN32\INCLUDE\XMLSEC\MSCRYPTO;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXSLT-1.1.16.WIN32\LIBXSLT-1.1.16.WIN32\INCLUDE;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXSLT-1.1.16.WIN32\LIBXSLT-1.1.16.WIN32\INCLUDE\LIBEXSLT;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\LIBXSLT-1.1.16.WIN32\LIBXSLT-1.1.16.WIN32\INCLUDE\LIBXSLT;
\
C:\PROJECTS\INPRIVA\CRYPTOAPI\XMLSEC\ZLIB-1.2.3.WIN32\ZLIB-1.2.3.WIN32\INCLUDE
SOURCES=cmdline.c \
crypto.c \
xmlsecfunctions.c
More information about the xmlsec
mailing list