4 messages in com.mysql.lists.plusplusRe: LNK2005 visual studio 2005| From | Sent On | Attachments |
|---|---|---|
| Nils Woetzel | 09 Jun 2007 11:55 | |
| casper china | 17 Jun 2007 17:50 | |
| Warren Young | 18 Jun 2007 22:32 | |
| Joel Fielder | 19 Jun 2007 03:28 |
| Subject: | Re: LNK2005 visual studio 2005![]() |
|---|---|
| From: | Warren Young (mysq...@etr-usa.com) |
| Date: | 06/18/2007 10:32:20 PM |
| List: | com.mysql.lists.plusplus |
Nils Woetzel wrote:
So I tried to get rid of MYSQLPP_EXPORT related to all std::vector<std::string> instantiations, which are only found for the FieldNames class. (field_names.h and row.h)
....
This resolved the entire linking issue in visual studio.
Patch applied. Thanks for the detailed report!
But now the problem might be that mingw will not do what it was supposed to do (at least what the comments in svn are saying).
I suppose a MinGW user will have to test it before the next release, then. :) I can't muster the will to fight with MinGW very often.
But building with mingw still works for me (I use g++ of mingw, but the cygwin make), I am not sure about other building systems, but since this is was only important for the windows dll I guess there might not be a reason to export the entire Field_Names class, but only the "Init" function.
A couple of errors here, I think.
First, I think the FieldTypes class also needs the same treatment.
Second, there's no point in exporting the init() function from these classes, as it is private. You can't use it from outside the library, even if you wanted to. Besides, the whole reason we can get away with removing MYSQLPP_EXPORT from these classes is that they're not supposed to be used directly from outside the library.
My patch takes these things into account.




