wxDatabaselayer for Firebird 2.0 with wxDevcpp Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
fabinhomartins
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 23, 2007 12:23 am

wxDatabaselayer for Firebird 2.0 with wxDevcpp

Post by fabinhomartins »

Good day, as I can compile wxDatabaselayer 1.7.1 for Firebird 2.0 with wxDevcpp, I tried this tip:

http://wxcode.sourceforge.net/docs/data ... evcpp.html

But I do not know which option to use.

I tried to compile in some options, generated this lib "databaselayer_firebird.a" of 678Kb. I created a new project includes all the necessary paths and libs but when I compile appears the following 2 errors:
[Linker Error] undefined reference to `fb_interpret@12'
[Linker Error] undefined reference to `fb_interpret@12'

Thanks.
loptr
Earned some good credits
Earned some good credits
Posts: 110
Joined: Tue Jan 23, 2007 12:22 pm
Location: Kiel, Germany
Contact:

Post by loptr »

i'm not sure where your problem lies... i had none compiling the lib for pgSQL...

is it that you don't succeed in compiling the lib for the FirebirdDatabaseLayer or that you can't link your projects against the new lib?

the hint-site you posted seems very clear to me. with screenshots... it's even the firebird sample! just enter everything as it is shown on the screens...
anyway, if you wish, we can set up a skype/icq/irc session and try it together...
fabinhomartins wrote:But I do not know which option to use.
which option regarding what? the libs to link against? the compiler flags? don't quite understand...
OS: Win XP PRO SP2 (fully updated)
proc: INTEL Core 2 Duo E6400
wx: wxDevCpp (always latest stable)
fabinhomartins
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 23, 2007 12:23 am

Post by fabinhomartins »

Hello, I delayed to answer because other projects had taken the time of my studies in wxWidgets.
I compiled and obtained the lib to Databaselayer for Firebird 2.0, but when I go to link it my project always appears this error:

Code: Select all

Compilador: Default GCC compiler
Building Makefile: "D:\Meus Documentos\Fabiano\wxWidgets\Exemplos_wxDevcpp\Firebird_Databaselayer_15-08-07\Makefile.win"
Executando  make...
mingw32-make.exe -f "D:\Meus Documentos\Fabiano\wxWidgets\Exemplos_wxDevcpp\Firebird_Databaselayer_15-08-07\Makefile.win" all 
windres.exe --input-format=rc -o Projeto1_private.res --include-dir "C:/ARQUIV~1/Dev-Cpp/include/common" PROJET~2.RC -O coff

g++.exe Projeto1App.o Projeto1Dlg.o Projeto1_private.res -o "Projeto1.exe" -L"C:/Arquivos de programas/Dev-Cpp/Lib" -L"D:/Instaladores/wxWidgets/databaselayer_src_1.6/databaselayer/lib" -L"C:/Arquivos de programas/Firebird/Firebird_2_0/lib" ../../../../../Instaladores/wxWidgets/databaselayer_src_1.6/databaselayer/lib/databaselayer_firebird.a "C:/Arquivos de programas/Firebird/Firebird_2_0/lib/fbclient_ms.lib" "C:/Arquivos de programas/Firebird/Firebird_2_0/lib/ib_util_ms.lib" -mwindows -lwxmsw28 -lwxmsw28_gl -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lopengl32  -s 

../../../../../Instaladores/wxWidgets/databaselayer_src_1.6/databaselayer/lib/databaselayer_firebird.a(FirebirdDatabaseLayer.o):FirebirdDatabaseLayer.cpp:(.text+0x2e82): undefined reference to `fb_interpret@12'
../../../../../Instaladores/wxWidgets/databaselayer_src_1.6/databaselayer/lib/databaselayer_firebird.a(FirebirdDatabaseLayer.o):FirebirdDatabaseLayer.cpp:(.text+0x2f48): undefined reference to `fb_interpret@12'
collect2: ld returned 1 exit status

mingw32-make.exe: *** [Projeto1.exe] Error 1

Execu
jb_coder
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Mon Oct 18, 2004 10:55 am

Post by jb_coder »

Are you linking with the firebird libraries? I think the filename is something like fbclient.lib
jb_coder
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Mon Oct 18, 2004 10:55 am

Post by jb_coder »

Sorry. Let me clarify that last post. It looks like you're statically linking to the Firebird libraries. You may have better luck if you dynamically link with -lfbclient_ms.
fabinhomartins
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 23, 2007 12:23 am

Post by fabinhomartins »

I made what you he suggested, I change the project options to -lfbclient_ms, I set paths of libs and includes too.
Now when I try this code:

Code: Select all

void Projeto1Dlg::WxButton1Click(wxCommandEvent& event)
{
    try
    {
        DatabaseLayer *db = new FirebirdDatabaseLayer();
        //db->Open(_("DBTESTE.GDB"));
    }//fim try

    catch(DatabaseLayerException& e)
    {
        wxMessageBox(wxString::Format(wxT("%d: %s."),e.GetErrorCode(),e.GetErrorMessage().c_str()),wxT("Database Error"));
    }//fim catch
}

the follow error that appears:

Code: Select all

g++.exe Projeto1App.o Projeto1Dlg.o Projeto1_private.res -o "Projeto1.exe" -L"C:/Arquivos de programas/Dev-Cpp/Lib" -L"C:/Arquivos de programas/Dev-Cpp/databaselayer/lib" -L"C:/Arquivos de programas/Firebird/Firebird_2_0/lib" -fbclient_ms -ib_util_ms -mwindows -lwxmsw28 -lwxmsw28_gl -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregex -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lopengl32 -databaselayer_firebird_ANSI_MONO  -s 

Projeto1Dlg.o:Projeto1Dlg.cpp:(.text+0xc8c): undefined reference to `FirebirdDatabaseLayer::FirebirdDatabaseLayer()'
collect2: ld returned 1 exit status

mingw32-make.exe: *** [Projeto1.exe] Error 1

Execu
jb_coder
Super wx Problem Solver
Super wx Problem Solver
Posts: 267
Joined: Mon Oct 18, 2004 10:55 am

Post by jb_coder »

The only configuration that I've tested thoroughly is statically linking to databaselayer_firebird.a while dynamically linking to fbclient_ms.lib (on Win32).
loptr
Earned some good credits
Earned some good credits
Posts: 110
Joined: Tue Jan 23, 2007 12:22 pm
Location: Kiel, Germany
Contact:

Post by loptr »

just an idea, because i had similar mysterious problems:
could it be that you have disabled exception handling for the compiler/linker by setting the -fnoexceptions flag (i think it's a compiler flag)?

that led to unexplainable compiler/linker errors until i switched the flag to -fexceptions... then everything worked fine and as expected...


==break==
i'm not quite sure (since my IDEs do all the config stuff for me), but i think the order of the switches also does matter for compiling and linking. did you try to move the -lfbclient_ms switch to the very end?
OS: Win XP PRO SP2 (fully updated)
proc: INTEL Core 2 Duo E6400
wx: wxDevCpp (always latest stable)
fabinhomartins
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 23, 2007 12:23 am

Post by fabinhomartins »

Thanks, for the reply.
I'll try.

Fabiano Martins.
fabinhomartins
Earned a small fee
Earned a small fee
Posts: 13
Joined: Fri Feb 23, 2007 12:23 am

Post by fabinhomartins »

It still did not work, but I go to again make everything since the start to see if I discover what is wrong.

Thanks a lot for the attention.
bone
Experienced Solver
Experienced Solver
Posts: 74
Joined: Fri Nov 30, 2007 10:11 am
Location: Oz

Post by bone »

[Linker Error] undefined reference to `fb_interpret@12'
[Linker Error] undefined reference to `fb_interpret@12'
I get the above errors when compiling the firebird test progs. The related related lines from FirebirdDatabaseLayer.cpp are
#if FB_API_VER==15
isc_interprete(szError, &pVector);
#else
fb_interpret(szError, 512, (const ISC_STATUS**)&pVector);
#endif
and in Firebird2.0\include\ibase.h
/* This const params version used in the engine and other places. */
ISC_LONG ISC_EXPORT fb_interpret(ISC_SCHAR*,
unsigned int,
const ISC_STATUS**);

If I add these lines to the databaselayer_tests.cpp
#ifndef USE_FIREBIRD_EMBEDDED
#define USE_FIREBIRD_EMBEDDED 1
#endif
Then they no longer cause an error but are replaced by other errors such as
[Warning] "SQL_FLOAT" redefined
But it compiles successfully albeit with lots of warnings. Maybe I will download VC++2008 Express and try that. Only a week down the drain so far.
terminus
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Jan 29, 2008 8:39 am
Location: Russia

Post by terminus »

[Linker Error] undefined reference to `fb_interpret@12'
[Linker Error] undefined reference to `fb_interpret@12'
I had the same problem.
I had uninstalled Firebird 1.5 and installed Firebird 2.0, but i had forgot to copy Firebird 2.0 *.lib files into the \mylib directory of my IDE. So i was trying to link FB 1.5 *.lib files while using FB 2.0.
When i have copied FB 2.0 *.lib files into \mylib my prog launched.
bone
Experienced Solver
Experienced Solver
Posts: 74
Joined: Fri Nov 30, 2007 10:11 am
Location: Oz

Post by bone »

I had all the libraries properly referenced and it wasn't until I built and upgraded to wxWidgets 2.8.7 that the fbinterpret@12 thingo resolved.
This happens on any new installation of wxDev-C++ I have done so I now just copy the files to Dev-Cpp's folders. I will cross the cross platform bridge when I come to it.
Cheers, John
Post Reply