dbTalk Databases Forums  

MinGW DLL build saga continues...

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss MinGW DLL build saga continues... in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Warren Young
 
Posts: n/a

Default MinGW DLL build saga continues... - 07-28-2005 , 06:52 PM






Thanks to some help from list member Robin, I've got a MinGW building
MySQL++ as a DLL. Unfortunately, there's a new problem, which is that
MinGW can't link programs to it.

VC++ builds DLLs just fine, so there's a limit to how much more effort
I'm willing to put into this. So, I hope some of you MinGW users out
there will try this, and see if you can figure out what MinGW is
complaining about.

To see the problem, check out a copy of the current repository version
of MySQL++, and type "makemake mingw" in the project directory to build
the DLL. The examples will fail to build, but nevermind that for now.
Try to build this simple program instead:

#include <mysql++.h>

int main()
{
mysqlpp::Connection c;
mysqlpp:ate d;
return 0;
}

The command line for that is:

g++ -Ic:\mysql\include -Ilib foo.cpp -o foo.exe \
-Lc:\mysql\lib\mingw -lmysql -Llib -lmysqlpp

....assuming that you call it foo.cpp and put it in the base project
directory.

You'll get these errors:

c:\tmp/ccuqhaaa.o(.text$_ZN7mysqlpp4DateD1Ev[mysqlpp:ate::~Date()]+0xb):foo.cp
p: undefined reference to `vtable for mysqlpp:ate'
c:\tmp/ccuqhaaa.o(.text$_ZN7mysqlpp4DateC1Ev[mysqlpp:ate:ate()]+0x16):foo.cp
p: undefined reference to `vtable for mysqlpp:ate'
collect2: ld returned 1 exit status

According to what I've found searching online, this means the linker
believes the subclass isn't defining all of the virtual functions
declared in its parent class(es). That's B.S., of course, because this
code works with many other platforms. Perhaps a clue lies in the
mangled names above: anyone have a tool to demangle arbitrary g++
symbols? (like nm -C does)

Notice that it doesn't complain about Connection, only Date. I've tried
several other classes here. The Exception subclasses compile and link,
for instance. But Fields and Row do not. What do these problem classes
have in common with each other, but not with the working classes?

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: MinGW DLL build saga continues... - 07-28-2005 , 07:31 PM






WOLFRAM (AT) ARNOLD (DOT) name wrote:
Quote:
Is it possible that there is some issue with the destructor being defined in
the header file for Date
If there is, it's a compiler bug. DTbase is a template, so all methods
_have_ to be defined in the header. Besides, the Exceptions are also
entirely defined within their header, and they work.

I apreciate your response, but it would be much more useful if you'd
test your hypotheses first.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
  #3  
Old   
Warren Young
 
Posts: n/a

Default Re: MinGW DLL build saga continues... - 08-02-2005 , 07:44 PM



Warren Young wrote:
Quote:
Thanks to some help from list member Robin, I've got a MinGW building
MySQL++ as a DLL. Unfortunately, there's a new problem, which is that
MinGW can't link programs to it.
Status update: this is the old "MinGW can't make a DLL" problem that
cropped up after the big file renaming in MySQL++ 1.7.20. The bit in
quotes is how I received the problem report, but it's not correct: MinGW
can make the DLL all right, it just refuses to link programs against it.

For now, I've checked in a change that builds a static library instead.
This works fine. The LGPL consequence of this is that you must
provide objects to your users if you make a closed-source program, so
they can relink it against a new MySQL++. If this is unacceptable to
you, use VC++, or help me fix this problem!

Now that I recognize this as the same old problem as was reported back
after 1.7.20, I'm confident that it can be fixed. The only question is
how much effort it will take, and who (if anyone) will be so moved as to
put forth that effort.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.