User forums > Help

Problem with --enable-auto-import with mysql++

<< < (6/6)

Matreju:
Identically Problem..

Code :

    mysqlpp::Connection DBCon = new mysqlpp::Connection();
    ci = DBCon.client_info();
  try {
    DBCon.connect(database,host,dbuser,dbpasswd);
  }
  catch(const mysqlpp::Exception& er) {
       error=DBCon.error();
       cerr << er.what() << endl;
  }
    mysqlpp::Query CategoriesQuery =  DBCon.query();


Linker error :/wxWidgets-2.6.3/include/wx/object.h:(.text$_ZN7mysqlpp5QueryD1Ev[mysqlpp::Query::~Query()]+0x52): variable 'vtable for mysqlpp::Query' can't be auto-imported. Please read the documentation for ld's --enable-auto-import for details.


At debugging the DBCon object is ok and have an connect.
But why there is no Query Object ?
( When i comment mysqlpp::Query CategoriesQuery =  DBCon.query(); out all works fine )

The .a Files are generated as in documentation .

Ceniza:
That error looks really strange. Why in wx/object.h in the first place?

You should ask the mysql++ people about it. I cannot help you with this one :(

Matreju:
I have make an post in mysql++ forums. What i have found is thats looke like a mingw port problem of mysql++
The exports arent allowed from mingw  . But mysql wrote thats correct and mingw have an error.
I am not an expert to mingw at this time so i dont know who is right.

Have anyone compiled it under Windows XP , gcc-3.4.4 (mingw special ) so it works ? Maybe other options or changing the sources.
I have used the original mingw Files from mysql++  ( mingw32-make -f Makefile.mingw BUILD=debug ..All libs build well. )

Ceniza:
Well, I just tried your example (had to add a few types to make it compile) and it was the output:


--- Quote from: Build log ----------------- Build: default in test ---------------
mingw32-g++.exe  -IC:\mysql++\include -IC:\mysql\include -IC:\MinGW\include  -c main.cpp -o .objs\main.o
mingw32-g++.exe -LC:\mysql++\lib -LC:\mysql\lib\opt -LC:\MinGW\lib  -o test.exe .objs\main.o    -lmysqlpp -lmysqlclient
Info: resolving vtable for mysqlpp::Queryby linking to __imp___ZTVN7mysqlpp5QueryE (auto-import)
Info: resolving VTT for mysqlpp::Queryby linking to __imp___ZTTN7mysqlpp5QueryE (auto-import)
Process terminated with status 0 (0 minutes, 3 seconds)
0 errors, 0 warnings
--- End quote ---

Those auto-imports look ugly but even that way it compiled.

Could you try following my steps to compile the library? At least I got it working that way here.

Navigation

[0] Message Index

[*] Previous page

Go to full version