logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Re: Link errors with resetdb example program: msg#00036

db.mysql.c++

Subject: Re: Link errors with resetdb example program

Hi there,

I tried what Warren and Chris suggested. Here are the results:

[dsmith@saquri01 test5]$ make
/opt/gcc/3.4.3/bin/gcc -c test.cpp -o test.o
/opt/gcc/3.4.3/bin/gcc -o test test.o -lstdc++
test.o(.gnu.linkonce.t._ZN4TestIcED1Ev+0x112): In function
`Test<char>::~Test()':
: undefined reference to `std::basic_iostream<char, std::char_traits<char>
>::~basic_iostream()'
test.o(.gnu.linkonce.t._ZN4TestIcEC1Ev+0x82): In function
`Test<char>::Test()':
: undefined reference to `std::basic_iostream<char, std::char_traits<char>
>::basic_iostream(std::basic_streambuf<char, std::char_traits<char> >*)'
test.o(.gnu.linkonce.r._ZTC4TestIcE0_Sd+0x18): undefined reference to
`std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
test.o(.gnu.linkonce.r._ZTC4TestIcE0_Sd+0x28): undefined reference to
`std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()'
test.o(.gnu.linkonce.t._ZN4TestIcED0Ev+0x112): In function
`Test<char>::~Test()':
: undefined reference to `std::basic_iostream<char, std::char_traits<char>
>::~basic_iostream()'
collect2: ld returned 1 exit status
make: *** [test] Error 1

This means I have a problem with libstdc++. I will see what I can do with
a development version of MySQL++ 2.0. I will email Jonathan Wakely and ask
him if there was a fix.

Thanks for everyone's help.

Dale Smith, Ph.D.
dalesmith@xxxxxxxx
DTCC Risk Management
Quantitative Group
212-855-7641




Chris Frey <cdfrey@xxxxxxxxxxxx>
06/12/2005 05:20 AM

To
plusplus@xxxxxxxxxxxxxxx
cc

Subject
Re: Link errors with resetdb example program






On Fri, Jun 10, 2005 at 03:32:07PM -0600, Warren Young wrote:
> Can you now try linking a basic "hello, world" type program against
> libmysql++? If you have to include something in the program to make
> sure it uses the library, use something peripheral within the library,
> like string2stream, or some of the primitive C type stuff in convert.h.
> You might find the #include graphs in the reference manual helpful
> here: choose something that doesn't eventually depend on query.h, or
> even row.h, connection.h, or coldata.h.

I'd recommend using the same program that Jonathan Wakely used in that
earlier thread Warren posted:
http://gcc.gnu.org/ml/libstdc++/2004-09/msg00125.html

#include <istream>
#include <ostream>

template <typename C>
class Test : public std::basic_iostream<C>
{
public:
Test() : std::basic_iostream<C>(0) {}
};

#include <iostream>

int main()
{
Test<char> t;
std::cout << '\n';
}

The iostream classes were designed with inheritance in mind, so inheriting
(and the destructors) shouldn't cause a problem.


> If the changes to Query will happen, it will
> happen during the v2.0 development. It is not yet certain that it will
> happen, because all known problems presently have reasonable
> workarounds. So far, the best reason I have to change it is that Scott
> Meyers said so. Not the best reason...

The reason to get rid of stream inheritance would be the copying that
Query objects might do, not the inheritance itself. And these link errors
all reference the destructor, which doesn't have anything to do with
copying, in my opinion.

Has anyone emailed Jonathan Wakely? Maybe he would remember what he did
to fix his problem. The thread doesn't seem to finish completely.

- Chris


--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=dalesmith@xxxxxxxx





Only community members can participate in forum threads. You must Register or log in to contribute.

<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo