[xmlsec] trouble on static linking xmlsec

Aleksey Sanin aleksey at aleksey.com
Wed Sep 10 14:35:55 PDT 2008


Could you please try to add

-DXMLSEC_NO_CRYPTO_DYNAMIC_LOADING=1


When you compile the sign3.c? BTW, it might be better
to use pkg-config or xmlsec1Conf.sh script to get
compiler/linker flags.

Best,
Aleksey

Ricardo Garcia Reis wrote:
> Hello,
> 
>  
> 
> I am having problems with Linux, with static configuring.
> 
>  
> 
> I am using xmlsec in my application windows (32bits) and Linux (32bits) 
> -> without xslt, with openssl 0.9.8g, libxml2 2.6.29 and generating 
> always static libs.
> 
> use the following definitions preprocessor: -DXMLSEC_CRYPTO_OPENSSL 
> -DXMLSEC_STATIC -DXMLSEC_NO_XSLT
> 
>  
> 
> using windows with "visual studio 2005 command prompt" generate the libs 
> as follows:
> 
> 1) cscript configure.js prefix=c:\opt include=c:\opt\include 
> lib=c:\opt\lib with-dl=no xslt=no
> 
> 2) changing the cruntime for /MT or /MTd
> 
> 3) worked fine
> 
>  
> 
>  
> 
> but I am having problems with Linux, with configuring
> 
>  
> 
> 1)./configure --enable-static --disable-shared --enable-shared=no 
> --with-libxslt=no --with-openssl=/usr/local/ssl
> 
>                 --enable-crypto-dl=no --enable-apps-crypto-dl=no  
> --enable-static-linking=yes
> 
>  
> 
> error occurring at the time of the application link:
> 
>  
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/.libs/libxmlsec1-openssl.a(libxmlsec1_openssl_la-crypto.o)(.text+0x68b): 
> In function `xmlSecOpenSSLInit':
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/crypto.c:267: undefined reference 
> to `xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms'
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/.libs/libxmlsec1-openssl.a(libxmlsec1_openssl_la-x509.o)(.text+0x398f): 
> In function `xmlSecOpenSSLKeyDataX509XmlWrite':
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/x509.c:711: undefined reference to 
> `xmlSecX509DataGetNodeContent'
> 
>  
> 
> occurs the problem compiling the sign3.c example, with the following 
> command line :
> 
>  
> 
> bash-2.05# gcc -I/home/ricardo/advtec9/libxml2 
> -I/usr/local/xmlsec1-1.2.11/include  -DXMLSEC_CRYPTO_OPENSSL 
> -DXMLSEC_STATIC -DXMLSEC_NO_XSLT -g  -DUNIX_SOCKETS  -g   sign3.c 
> -L/usr/local/xmlsec1-1.2.11/src/.libs -lxmlsec1 
> -L/usr/local/xmlsec1-1.2.11/src/openssl/.libs -lxmlsec1-openssl 
> -L/home/ricardo/advtec9/libxml2/linux -lxml2  
> -L/home/ricardo/advtec9/openssl/linux -lssl -lcrypto -ldl -lstdc++ -o sign3
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/.libs/libxmlsec1-openssl.a(libxmlsec1_openssl_la-crypto.o)(.text+0x68b): 
> In function `xmlSecOpenSSLInit':
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/crypto.c:267: undefined reference 
> to `xmlSecCryptoDLFunctionsRegisterKeyDataAndTransforms'
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/.libs/libxmlsec1-openssl.a(libxmlsec1_openssl_la-x509.o)(.text+0x398f): 
> In function `xmlSecOpenSSLKeyDataX509XmlWrite':
> 
> /usr/local/xmlsec1-1.2.11/src/openssl/x509.c:711: undefined reference to 
> `xmlSecX509DataGetNodeContent'
> 
> collect2: ld returned 1 exit status
> 
>  
> 
>  
> 
> Thanks in advanced.
> 
>  
> 
> Ricardo
> 
>  
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec



More information about the xmlsec mailing list