Author Topic: Problem with --enable-auto-import with mysql++  (Read 16589 times)

Offline Alexbad

  • Multiple posting newcomer
  • *
  • Posts: 10
    • OwnBloog
Re: Problem with --enable-auto-import with mysql++
« Reply #15 on: June 04, 2006, 04:47:08 am »
Simply because it doesn't work anymore, so I think I do something wrong...

Ceniza told me that the .lib extension were just supported by VC, and I don't find any mysqlclient.a.  Of course I get a file named libmysqlclient.a but not mysqlclient.a
« Last Edit: June 04, 2006, 04:52:58 am by Alexbad »
:) Alexbad :)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #16 on: June 04, 2006, 04:53:02 am »
Latest nightly (03 June)

libmysqlclient.a is the right name. Please install the Nightly and try again.

Offline Alexbad

  • Multiple posting newcomer
  • *
  • Posts: 10
    • OwnBloog
Re: Problem with --enable-auto-import with mysql++
« Reply #17 on: June 04, 2006, 05:45:13 am »
Ok, I think this time the Nightly build is installed : the interface is changed and there's a new tab in the build options.

I tried to compile my code, I get a popup telling me :

"It seems that this project has not been build yet. Do you want to build it now?"

Of course I answer yes but the same popup reopen, again and again, until I click on "Cancel", and my program doesn't launch. This problem has nothing to see with mysql because I have it with all my old c::b project... and even with this code :

Code: C++
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.         printf("Hello world");
  6. }

And when I click on "Rebuild" :



Thanks again for your patience :)
:) Alexbad :)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #18 on: June 04, 2006, 06:40:20 am »
My guess: you didn't configure the Nightly to use RC2's compiler, so it's unable to find mingw32-g++.exe

Check "Settings->Compiler and debugger" then the tab "Programs". "Compiler's installation directory" must point to the directory where RC2's compiler was installed (it should have directories like bin, include, lib, ...). My guess is it must be somewhere in C:\Program files\CodeBlocks (since I never installed the RC2 version that includes the compiler I don't have idea where it's saved).

Searching for mingw32-g++.exe should give you the right path, and it should be inside a directory named bin. Just add that path in "Compiler's installation directory", but don't include the "bin" directory on it.

Offline Alexbad

  • Multiple posting newcomer
  • *
  • Posts: 10
    • OwnBloog
Re: Problem with --enable-auto-import with mysql++
« Reply #19 on: June 04, 2006, 04:09:38 pm »
It works now for the compiler, I don't know why but it was the DevCpp's directories, I changed them...

Now, I always get a undefined reference, here you can see all : http://www.la-page.qc.ca/bd.PNG
:) Alexbad :)

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Problem with --enable-auto-import with mysql++
« Reply #20 on: June 04, 2006, 05:12:45 pm »
It works now for the compiler, I don't know why but it was the DevCpp's directories, I changed them...

Hello,

I think it would be better to have a separate MinGW installation rather than to use the MinGW of RC2.

Best wishes,
Michael

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #21 on: June 04, 2006, 08:41:26 pm »
Everything seems to be OK with your configuration. There's no complaint about that library not being found this time, but it cannot find the method...

Could you post the file size of that library to compare with mine? I'm getting out of ideas now :)

Offline Alexbad

  • Multiple posting newcomer
  • *
  • Posts: 10
    • OwnBloog
Re: Problem with --enable-auto-import with mysql++
« Reply #22 on: June 04, 2006, 08:44:38 pm »
libmysqlclient.a : 2 kb

I think about it, this is not too much...
:) Alexbad :)

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #23 on: June 04, 2006, 08:51:14 pm »
107KB here.

Try the steps to build the library again. Maybe you missed something :)

Offline Alexbad

  • Multiple posting newcomer
  • *
  • Posts: 10
    • OwnBloog
Re: Problem with --enable-auto-import with mysql++
« Reply #24 on: June 04, 2006, 08:57:40 pm »
NICE!!! :D :D

Now it works fine, thanks a lot for your help Ceniza, Michael and all the others!
:) Alexbad :)

Offline Matreju

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Problem with --enable-auto-import with mysql++
« Reply #25 on: June 21, 2006, 08:17:23 pm »
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 .
« Last Edit: June 21, 2006, 08:19:08 pm by Matreju »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #26 on: June 22, 2006, 03:10:43 am »
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 :(

Offline Matreju

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Problem with --enable-auto-import with mysql++
« Reply #27 on: June 22, 2006, 11:14:40 am »
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. )

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Problem with --enable-auto-import with mysql++
« Reply #28 on: June 22, 2006, 08:58:44 pm »
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

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.