List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:June 19 2007 5:32am
Subject:Re: LNK2005 visual studio 2005
View as plain text  
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.
Thread
LNK2005 visual studio 2005Nils Woetzel9 Jun
  • Re: LNK2005 visual studio 2005casper china18 Jun
  • Re: LNK2005 visual studio 2005Warren Young19 Jun
    • RE: LNK2005 visual studio 2005Joel Fielder19 Jun