Problems with linking GiNaC

Richard B. Kreckel kreckel at
Wed Sep 24 21:31:02 CEST 2003


On Wed, 24 Sep 2003 paul81 at wrote:
> I used the command
>    g++ $(ginac-config --libs) example.c++
> ld returns many error messages (too much to send them). Basicly there
> two types. First many messages like
> example.o(.text+0x47): In function `main':
> : undefined reference to `GiNaC::symbol::symbol[in-charge](std::basic_string<char, std::char_traits<char>, std::allocator<
> char> > const&)'
> And for (I think) every reference in the object file. And second there
> also messages like:
> /usr/lib/ undefined reference to `cerr'
> /usr/lib/ undefined reference to `cln::compare(cln::cl_R const &, cln::cl_R const &)'
> (Very much of them, too).
> I have checked ginac-config. It seems to report the right
> libraries. When I tried static linking some of the messages
> disappeared, but only a few.
> Can anyone tell me, how I can get those examples run?

The command above is correct.

> PS: My systems configuration:
>    g++ (GCC) 3.2.3 20030309 (Debian prerelease)
>    GiNaC 1.0.11-1
> 	(the debian packages: libginac-dev 1.0.11-1 & libginac0 1.0.11-1)
>    CLN 1.1.5-1 (Debian: libcln2 1.1.5-1)
>    and Debian GNU/Linux 2.4.17

That's quite a version mismatch.  You are using GCC from sarge or sid and
GiNaC from woody.  That GiNaC version from woody was compiled using
GCC-2.95.3.  The change in name mangling between GCC 2.95.x and GCC 3.0
accounts for your missing symbols.

How did that configuration happen?  Can't you just apt-get install
GiNaC-1.1.<something>?  That should get you libginac1.1, libginac-dev and
(if you wish) the corresponding ginac-tools.

  .''`.  Richard B. Kreckel
 : :' :  <kreckel at>
 `. `'   <kreckel at>
   `-    <>

More information about the GiNaC-list mailing list