List:MySQL++« Previous MessageNext Message »
From:Andrew Ray Date:November 12 2010 9:36am
Subject:Link error when building mysql++-3.1.0 with --as-needed
View as plain text  
Hi,

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?).

Gentoo has recently defaulted to using the "--as-needed" flag for
linking, and it seems to be at the root of the problem I am having here,
since when I build without that flag, everything works.  I believe the
solution is simple, but I don't have any experience with Makefiles or
bakefiles, and my attempts at altering the bakefile have proved
fruitless.  From what I can tell ssqls2parse is the first to be linked,
and the problem occurs because the main library which one of its
functions depends on hasn't yet been linked.

I think that if the bakefile could be modified to make this depend on
the main library, and cause the main library to be linked before it,
then everything would work fine.  As I said, my attempts to modify the
bakefile have failed, as I am not totally sure what needs to be done.

(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,

Andrew Ray

Error messages from build:

./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o): In function
`ParseV2::Option::parse_bool(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
parsev2.cpp:(.text+0x495): undefined reference to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o): In function
`ParseV2::Field::Type::Type(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
parsev2.cpp:(.text+0xb4b): undefined reference to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o): In function
`ParseV2::Field::Type::Type(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)':
parsev2.cpp:(.text+0xdab): undefined reference to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o): In function
`ParseV2::Field::parse(std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&, bool, ParseV2::File const&)':
parsev2.cpp:(.text+0x1504): undefined reference to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o): In function
`ParseV2::Table::parse(std::vector<std::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::basic_string<char, std::char_traits<char>,
std::allocator<char> > > > const&, bool, ParseV2::File const&)':
parsev2.cpp:(.text+0x2d86): undefined reference to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)'
./libmysqlpp_ssqls2parse.a(ssqls2parse_parsev2.o):parsev2.cpp:(.text+0x330a):
more undefined references to
`mysqlpp::internal::str_to_lwr(std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)' follow
collect2: ld returned 1 exit status
make: *** [test_ssqls2] Error 1

-- 
Andrew Ray
Operatio riaditeľ
(Operations director)
Centrum pre bioetickú reformu
www.pravonazivot.sk

www.abortionno.org 
(related American organization)

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