Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / ODBC-class is missing in my wxWindows compilation.

Register 
新用户注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. ODBC-class is missing in my wxWindows compilation.
#8178
Posted by: 2006-04-27 17:48:49
I created some GUI which compiled and worked, but now I am trying to add ODBC support to my project.

My env is: DEVCPP, MINGW32, wxWindows 2.3.2

I changed the setup.h so wxUSE_ODBC = 1

I added the following code fragment to my project:

    // obtain DB-connection with default user & DB
    wxDbConnectInf *DbConnectInf = NULL;

    DbConnectInf = new wxDbConnectInf(NULL,"MySQL5","joe", "-------");

    if (!DbConnectInf || !DbConnectInf->GetHenv())
    {
      wxMessageBox("Unable to allocate an ODBC environment handle",
            "DB CONNECTION ERROR", wxOK | wxICON_EXCLAMATION);
    }
    else
    {
      wxMessageBox("Connected",
            "...", wxOK | wxICON_EXCLAMATION);
       // The program is now ending, so we need to close
       // any cached connections that are still being
       // maintained.
       wxDbCloseConnections();

       // Release the environment handle that was created
       // for use with the ODBC datasource connections
       delete DbConnectInf;
    }


after compilation I get linker errors:
[Linker error] undefined reference to `wxDbConnectInf::wxDbConnectInf(void*, wxString const&, wxString const&, wxString const&, wxString const&, wxString const&, wxString const&)'
 
[Linker error] undefined reference to `wxDbCloseConnections()'
 
[Linker error] undefined reference to `wxDbConnectInf::~wxDbConnectInf()'


How do I rebuild wx-library so the DB/ODBC support will be included?
(I just can't find the propare make file)

or maybe it's not the library and there is some other problem?

My project settings:
C++ Compiler parameters:
-DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H  -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions

Linker:
-Wl,--subsystem,windows -mwindows -lwxmsw -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid


anyone?
Thanks.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Mon 2018-7-23  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0