List:MySQL++« Previous MessageNext Message »
From:Adrian Cornish Date:November 12 2010 4:44pm
Subject:Re: Link error when building mysql++-3.1.0 with --as-needed
View as plain text  
On Fri, Nov 12, 2010 at 2:36 AM, Andrew Ray <andrew@stripped> wrote:

> I use Gentoo Linux and am trying to create an ebuild (gentoo's software
> distribution file) to make MySQL++ 3.1.0.  I included already the patch
> to fix the problem with the missing #include <string.h> from genv2.cpp
> (I wonder why this isn't fixed in the source tarball?).
>


Hi Andrew,

Its already there twice already in truck - which should be more then enough
;-)

#include <cstring>
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <cstring>


(For now I am just canceling --as-needed for this ebuild, but I would
> like to submit it for inclusion into portage, and I don't think they'll
> go for that solution.)
>
> Thanks for any help,


This is related to link order, please place static library
mysqlpp_ssqls2parser before the "--as-needed" flag and it will link fine.

 g++ -o test_ssqls2 test_ssqls2_ssqls2.o -lmysqlpp_ssqls2parse
-Wl,--as-needed -L. -L/usr/local/lib/mysql -lmysqlclient -lmysqlpp

Just for reference (because I had too look it up as well in ld's man page)

--as-needed
--no-as-needed
This option affects ELF DT_NEEDED tags for dynamic libraries mentioned on
the command line  after  the  --as-needed  option. Normally,  the linker
will add a DT_NEEDED tag for each dynamic library mentioned on the command
line, regardless of whether the library is actually needed.  --as-needed
causes DT_NEEDED tags to only be emitted for libraries that satisfy some
symbol reference  from  regular  objects  which is undefined at the point
that the library was linked.  --no-as-needed restores the default behaviour.


Adrian

Thread
Link error when building mysql++-3.1.0 with --as-neededAndrew Ray12 Nov
  • Re: Link error when building mysql++-3.1.0 with --as-neededAdrian Cornish12 Nov
    • Re: Link error when building mysql++-3.1.0 with --as-neededAdrian Cornish12 Nov
    • Re: Link error when building mysql++-3.1.0 with --as-neededWarren Young12 Nov
      • Re: Link error when building mysql++-3.1.0 with --as-neededWarren Young12 Nov
        • Re: Link error when building mysql++-3.1.0 with --as-neededAdrian Cornish12 Nov
          • Re: Link error when building mysql++-3.1.0 with --as-neededWarren Young12 Nov
  • Re: Link error when building mysql++-3.1.0 with --as-neededWarren Young12 Nov