Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. firebird database - ibpp
Qt 6.12 LTS is out! See what's new in the release blog

firebird database - ibpp

Scheduled Pinned Locked Moved General and Desktop
18 Posts 3 Posters 11.1k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jleko
    wrote on last edited by jleko
    #7

    I'm using qt 5.8
    Here is the content of .cpp, .h and .pro files, and text of error:
    //qt pro file
    #-------------------------------------------------

    Project created by QtCreator 2017-04-12T23:31:36

    #-------------------------------------------------

    QT += core gui sql

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = qtfb2
    TEMPLATE = app

    The following define makes your compiler emit warnings if you use

    any feature of Qt which as been marked as deprecated (the exact warnings

    depend on your compiler). Please consult the documentation of the

    deprecated API in order to know how to port your code away from it.

    DEFINES += QT_DEPRECATED_WARNINGS

    You can also make your code fail to compile if you use deprecated APIs.

    In order to do so, uncomment the following line.

    You can also select to disable deprecated APIs only up to a certain version of Qt.

    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

    SOURCES += main.cpp
    mainview.cpp

    HEADERS += mainview.h
    ibpp-core/_ibpp.h
    ibpp-core/ibase.h
    ibpp-core/iberror.h
    ibpp-core/ibpp.h

    FORMS += mainview.ui

    #IBPP
    win32 {
    LIBS += -LC:/Firebird/Firebird_3_0/lib
    LIBS += -lAdvapi32 -lfbclient_ms
    DEFINES += IBPP_WINDOWS
    DEFINES += MBCS
    DEFINES -= -UNICODE
    QMAKE_CXXFLAGS += -DIBPP_WINDOWS

    #LIBS += -LC:/Firebird/Firebird_2_5/lib
    }
    INCLUDEPATH += c:/Firebird/Firebird_3_0/include

    #C++ flags
    #CONFIG += c++11
    #CONFIG += c++14

    //mainview.cpp
    #include "mainview.h"
    #include "ui_mainview.h"
    #include <iostream>
    #include <string>
    #include <QDebug>
    #include "ibpp-core/ibpp.h"

    using namespace IBPP;
    using namespace std;

    MainView::MainView(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainView)
    {
    ui->setupUi(this);
    db=IBPP::DatabaseFactory(serverName,dbName,userName, password);
    }

    MainView::~MainView()
    {
    delete ui;
    }

    //mainview.h
    #ifndef MAINVIEW_H
    #define MAINVIEW_H

    #include <QMainWindow>
    #include <string>
    #include "ibpp-core/ibpp.h"
    #include "ibpp-core/_ibpp.h"
    using namespace IBPP;
    using namespace std;

    namespace Ui {
    class MainView;
    }

    class MainView : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainView(QWidget *parent = 0);
    ~MainView();

    private:
    Ui::MainView ui;
    Database db;
    const string dbName = "C:/Firebird/Firebird_3_0/examples/JLEKOTEST.FDB";
    const string serverName = "localhost";
    const string userName = "SYSDBA";
    const string password = "
    ***";
    };

    #endif // MAINVIEW_H

    //qt issues
    mainview.obj:-1: error: LNK2019: unresolved external symbol "class IBPP::Ptr<class IBPP::IDatabase> __cdecl IBPP::DatabaseFactory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?DatabaseFactory@IBPP@@YA?AV?$Ptr@VIDatabase@IBPP@@@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000000@Z) referenced in function "class IBPP::Ptr<class IBPP::IDatabase> __cdecl IBPP::DatabaseFactory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?DatabaseFactory@IBPP@@YA?AV?$Ptr@VIDatabase@IBPP@@@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z)

    debug\qtfb2.exe:-1: error: LNK1120: 1 unresolved externals

    //compile output
    11:36:38: Running steps for project qtfb2...
    11:36:38: Configuration unchanged, skipping qmake step.
    11:36:38: Starting: "C:\Qt\Tools\QtCreator\bin\jom.exe"
    C:\Qt\Tools\QtCreator\bin\jom.exe -f Makefile.Debug
    cl -c -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -DIBPP_WINDOWS -Zi -MDd -GR -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fddebug\qtfb2.vc.pdb -DWIN32 -DWIN64 -DQT_DEPRECATED_WARNINGS -DIBPP_WINDOWS -DMBCS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I..\qtfb2 -I. -Ic:\Firebird\Firebird_3_0\include -IC:\Qt\5.8\msvc2015_64\include -IC:\Qt\5.8\msvc2015_64\include\QtWidgets -IC:\Qt\5.8\msvc2015_64\include\QtGui -IC:\Qt\5.8\msvc2015_64\include\QtANGLE -IC:\Qt\5.8\msvc2015_64\include\QtSql -IC:\Qt\5.8\msvc2015_64\include\QtCore -Idebug -I. -IC:\Qt\5.8\msvc2015_64\mkspecs\win32-msvc2015 -Fodebug\ @C:\Users\jozol\AppData\Local\Temp\mainview.obj.3512.15.jom
    mainview.cpp
    link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='' processorArchitecture=''" /MANIFEST:embed /OUT:debug\qtfb2.exe @C:\Users\jozol\AppData\Local\Temp\qtfb2.exe.3512.3015.jom
    mainview.obj : error LNK2019: unresolved external symbol "class IBPP::Ptr<class IBPP::IDatabase> __cdecl IBPP::DatabaseFactory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?DatabaseFactory@IBPP@@YA?AV?$Ptr@VIDatabase@IBPP@@@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000000@Z) referenced in function "class IBPP::Ptr<class IBPP::IDatabase> __cdecl IBPP::DatabaseFactory(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?DatabaseFactory@IBPP@@YA?AV?$Ptr@VIDatabase@IBPP@@@1@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@000@Z)
    debug\qtfb2.exe : fatal error LNK1120: 1 unresolved externals
    jom: C:\Users\jozol\OneDrive\APP-DEMO\build-qtfb2-Desktop_Qt_5_8_0_MSVC2015_64bit-Debug\Makefile.Debug [debug\qtfb2.exe] Error 1120
    jom: C:\Users\jozol\OneDrive\APP-DEMO\build-qtfb2-Desktop_Qt_5_8_0_MSVC2015_64bit-Debug\Makefile [debug] Error 2
    11:36:41: The process "C:\Qt\Tools\QtCreator\bin\jom.exe" exited with code 2.
    Error while building/deploying project qtfb2 (kit: Desktop Qt 5.8.0 MSVC2015_64bit)
    The kit Desktop Qt 5.8.0 MSVC2015_64bit has configuration issues which might be the root cause for this problem.
    When executing step "Make"
    11:36:41: Elapsed time: 00:03.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #8

      Are you sure you are linking to all the required libraries ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 1 Reply Last reply
      0
      • SGaistS SGaist

        Are you sure you are linking to all the required libraries ?

        J Offline
        J Offline
        jleko
        wrote on last edited by
        #9

        @SGaist I'm not sure, if you have a suggestion please be my guest...

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #10

          For which version of MSVC are your Firebrid libraries compiled ?

          What about ib_util_ms.lib ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          J 1 Reply Last reply
          1
          • SGaistS SGaist

            For which version of MSVC are your Firebrid libraries compiled ?

            What about ib_util_ms.lib ?

            J Offline
            J Offline
            jleko
            wrote on last edited by
            #11

            @SGaist
            Hi, I reinstalled Qt with MinGW, included ib_util_ms.lib and error looks like this:

            22:05:37: Running steps for project qtfb2...
            22:05:37: Configuration unchanged, skipping qmake step.
            22:05:37: Starting: "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" 
            C:\Qt\5.8\mingw53_32\bin\qmake.exe -o Makefile ..\qtfb2\qtfb2.pro -spec win32-g++ "CONFIG+=debug" "CONFIG+=qml_debug"
            C:/Qt/Tools/mingw530_32/bin/mingw32-make -f Makefile.Debug
            mingw32-make[1]: Entering directory 'C:/Users/jozol/OneDrive/APP-DEMO/build-qtfb2-Desktop_Qt_5_8_0_MinGW_32bit-Debug'
            g++ -Wl,-subsystem,windows -mthreads -o debug\qtfb2.exe debug/main.o debug/mainview.o debug/moc_mainview.o  -lmingw32 -LC:\Qt\5.8\mingw53_32\lib C:\Qt\5.8\mingw53_32\lib\libqtmaind.a -LC:\utils\my_sql\my_sql\lib -LC:\utils\postgresql\pgsql\lib -lshell32 -LC:\Firebird\Firebird_3_0\lib -LC:\Firebird\Firebird_3_0\WOW64\lib -lAdvapi32 -lfbclient_ms -lib_util_ms C:\Qt\5.8\mingw53_32\lib\libQt5Widgetsd.a C:\Qt\5.8\mingw53_32\lib\libQt5Guid.a C:\Qt\5.8\mingw53_32\lib\libQt5Sqld.a C:\Qt\5.8\mingw53_32\lib\libQt5Cored.a 
            debug/mainview.o: In function `ZN4IBPP15DatabaseFactoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_S7_':
            C:\Users\jozol\OneDrive\APP-DEMO\build-qtfb2-Desktop_Qt_5_8_0_MinGW_32bit-Debug/../qtfb2/ibpp-core/ibpp.h:875: undefined reference to `IBPP::DatabaseFactory(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
            collect2.exe: error: ld returned 1 exit status
            Makefile.Debug:69: recipe for target 'debug\qtfb2.exe' failed
            mingw32-make[1]: *** [debug\qtfb2.exe] Error 1
            mingw32-make[1]: Leaving directory 'C:/Users/jozol/OneDrive/APP-DEMO/build-qtfb2-Desktop_Qt_5_8_0_MinGW_32bit-Debug'
            Makefile:34: recipe for target 'debug' failed
            mingw32-make: *** [debug] Error 2
            22:05:39: The process "C:\Qt\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2.
            Error while building/deploying project qtfb2 (kit: Desktop Qt 5.8.0 MinGW 32bit)
            When executing step "Make"
            22:05:39: Elapsed time: 00:03.
            

            When I comment this line in .cpp file
            // db=IBPP::DatabaseFactory(serverName,dbName,userName, password);
            no error occures...
            I really don't know what to do...I read on internet that this could be encoding problem, but I'm newb and it is little bit complex for me...
            Regards.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #12

              Again: which compiler was used to build your IBPP libraries ? It's really important on Windows since you can't mix and match compilers. Only VS2017 is compatible with VS2015.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              J 1 Reply Last reply
              1
              • SGaistS SGaist

                Again: which compiler was used to build your IBPP libraries ? It's really important on Windows since you can't mix and match compilers. Only VS2017 is compatible with VS2015.

                J Offline
                J Offline
                jleko
                wrote on last edited by
                #13

                @SGaist
                Where can I see that?
                I'm including only ibpp.h file in my project, no ibpp library file.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  Check the content of your package, README file etc. You can run Dependency Walker.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    TioRoy
                    wrote on last edited by
                    #15

                    Checking the ZIP file contentes from https://www.firebirdsql.org/en/firebird-3-0-2/. Firebird is using MS compiler.

                    So, do not use MingW.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      jleko
                      wrote on last edited by
                      #16

                      Is there a way around this?
                      Compilig a qibase driver maybe...

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #17

                        A way around what ?

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          jleko
                          wrote on last edited by
                          #18

                          IBPP does not work with firebird3, I tried it with 2.5 and it works Ok.....

                          1 Reply Last reply
                          0

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt
                          • Unsolved