You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Weiwei Wang <ww...@gmail.com> on 2010/08/21 16:28:16 UTC

statically link xerces 64 binary version under linux

Hi, all,
      I'm a freshman for linux programming and am using xerces to do some
work.

As I need to run my program on a different linux machin so I need to
statically link the xerces lib for my project.

I tried -DXERCES_SATIC_LIBRARY but it does not work:(

Anyone here know the solution? Please do me a favor~~

-- 
Weiwei Wang
Naning University, P.R.China

Re: statically link xerces 64 binary version under linux

Posted by Weiwei Wang <ww...@gmail.com>.
Thanks, Boris,
               I have fixed this problem.
             1.  My first solution is to rename the share library(.so
files). This solution works not very good as the g++ complains :undefined
reference to '__ctype_b', I googled and add some code to fix this problem.

          2. My second solution works very good. I downloaded the xerces c++
3.11 source code and compile it myself under my develop machine. After
compiling , I copied the lib to my lib directory. It works fine when i add
-lcurl to the link flags though I don't know why I should add this flag.


On my own laptop, there are no difficulties as apt-get helps me do all the
job. My develop machine uses RedHat and the gcc/g++ version is not
update-to-date, I hate not having authority to update the software on my dev
machine.

On Tue, Aug 24, 2010 at 5:12 AM, Boris Kolpackov <bo...@codesynthesis.com>wrote:

> Hi Weiwei,
>
> Weiwei Wang <ww...@gmail.com> writes:
>
> > As I need to run my program on a different linux machin so I need to
> > statically link the xerces lib for my project.
>
> Try to specify libxerces-c.a directly instead of -lxerce-c in your
> linker command line. Something like /usr/lib/libxerces-c.a
>
>
> > I tried -DXERCES_SATIC_LIBRARY but it does not work:(
>
> This is only necessary for Windows/VC++.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis
> http://codesynthesis.com/~boris/blog
> Open-source XML data binding for C++
> http://codesynthesis.com/products/xsd
> XML data binding for embedded systems
> http://codesynthesis.com/products/xsde
> Command line interface to C++ compiler
> http://codesynthesis.com/projects/cli
>



-- 
王巍巍
百度 商务搜索部
工位:F5-BE327 分机:5594
地址:北京市海淀区上地十街10号 百度大厦 100085
手机:18601042316       百度 Hi: elegate

Re: statically link xerces 64 binary version under linux

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Weiwei,

Weiwei Wang <ww...@gmail.com> writes:

> As I need to run my program on a different linux machin so I need to
> statically link the xerces lib for my project.

Try to specify libxerces-c.a directly instead of -lxerce-c in your
linker command line. Something like /usr/lib/libxerces-c.a


> I tried -DXERCES_SATIC_LIBRARY but it does not work:(

This is only necessary for Windows/VC++.

Boris

-- 
Boris Kolpackov, Code Synthesis        http://codesynthesis.com/~boris/blog
Open-source XML data binding for C++   http://codesynthesis.com/products/xsd
XML data binding for embedded systems  http://codesynthesis.com/products/xsde
Command line interface to C++ compiler http://codesynthesis.com/projects/cli