I Need help in cross compiling Qt with firebird step by step



  • How do I cross compile and set up Qt Configuration with firebird? I'm currently using this configuration:

    ./configure -embedded arm -prefix /mypath -xplatform qws/linux-arm-none-gnueabi -qt-sql-ibase

    I received this error message in the end:

    collect2: ld returned 1 exit status
    make: *** [ibase] Error 1
    InterBase disabled.
    InterBase support cannot be enabled due to functionality tests!
    Turn on verbose messaging (-v) to ./configure to see the final report.
    If you believe this message is in error you may use the continue
    switch (-continue) to ./configure to continue.

    I'm using Ubuntu Operating System and arm-none-linux-gnueabi-g++ cross compiler.

    I hope someone can help me solving this kind of problem. thanks



  • I have not done what you are trying to accomplish but have you tried doing what it says: add -v to ./configure command and you will get more detailed error message. If error message will not help for you then copy-paste it here and maybe someone will help you.

    Similar problem here (http://www.qtcentre.org/threads/21924-Compiling-Qt-with-Firebird-support-on-Mac) says that you must have firebug installed. Since you are on Ubuntu I would expect some firebug-dev or other *-dev package to be installed.



  • Here is the report of my unsuccessful configuration:

    InterBase auto-detection... ()
    arm-none-linux-gnueabi-g++ -c -pipe -O2 -Wall -W -I../../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -o ibase.o ibase.cpp
    ibase.cpp:42:19: error: ibase.h: No such file or directory
    make: *** [ibase.o] Error 1
    InterBase disabled.
    InterBase support cannot be enabled due to functionality tests!
    Turn on verbose messaging (-v) to ./configure to see the final report.
    If you believe this message is in error you may use the continue
    switch (-continue) to ./configure to continue.

    I am really interested learning this process and I hope somebody will guide me how I can set it up correctly. thanks again.



  • Look, you already got good error:

    ibase.cpp:42:19: error: ibase.h: No such file or directory

    First thing I would try to figure out if ibase.h is part of Qt or Firebird include file. If it is Firebird include file then link I gave previously shows how to point additional include paths and libs file for ./configure (you should point them to Firebird include and lib pats). If ibase.h is Qt file then you will need to read ibase qt code (start with *.pro file) and figure out what's wrong with Qt (again link I gave before gives some hints/ideas).

    In the worst case you can simply google error message "ibase.cpp:42:19: error: ibase.h: No such file or directory" - while most probably that will not help a lot.



  • daliusd, Thank you for your quick response. I've modified config.tests/unix/ibase/ibase.pro

    I replaced LIBS += -lgds into LIBS += -fbclient

    and I've configured Qt again having option like this:

    ./configure -prefix /extdesk -no-qt3support -qt-sql-ibase -v

    then it allows me to built Qt application and read data to firebird database running on Ubuntu Distribution. but when I modified config.tests/unix/ibase/ibase.pro

    I replaced LIBS += -lgds into LIBS += -fbclient

    and I've downloaded firebird for armel library somewhere on the internet and extract it into my "fbc" directory.

    /fbc/usr/include/

    • ibase.h
    • iberror.h
    • ibutil.h
    • perf.h

    /fbc/usr/lib/arm-linux-gnueabi/

    and I tried to cross-compile and having this options:

    ./configure -embedded arm -prefix /ext -xplatform qws/linux-arm-gnueabi-g++ -no-qt3support -qt-sql-ibase -v -L/fbc/usr/lib/linux-arm-gnueabi -I/fbc/usr/include

    unluckily it gives me this error:

    InterBase auto-detection... ()
    arm-none-linux-gnueabi-g++ -c -pipe -O2 -Wall -W -I../../../mkspecs/qws/linux-arm-gnueabi-g++ -I. -I/fbc/usr/include -o ibase.o ibase.cpp
    arm-none-linux-gnueabi-g++ -Wl,-O1 -o ibase ibase.o -L/fbc/usr/lib/linux-arm-gnueabi -lfbclient
    /emb/arm/bin/../lib/gcc/arm-none-linux-gnueabi/4.2.0/../../../../arm-none-linux-gnueabi/bin/ld: cannot find -lfbclient
    collect2: ld returned 1 exit status
    make: *** [ibase] Error 1
    InterBase disabled.
    InterBase support cannot be enabled due to functionality tests!
    Turn on verbose messaging (-v) to ./configure to see the final report.
    If you believe this message is in error you may use the continue
    switch (-continue) to ./configure to continue.



  • Look. To ./configure you pass:

    -L/fbc/usr/lib/linux-arm-gnueabi

    and later write that fbs looks like this:

    /fbc/usr/lib/arm-linux-gnueabi/

    Maybe that's why it cannot find fbclient lib.



  • hmmm. I still have no luck cross compiling Qt with interbase enabled. thanks again daliusd.



  • Does enabling tslib in Qt have the same procedure in enabling interbase while cross-compiling? here is the link on building tslib http://importgeek.wordpress.com/2012/04/09/compiling-qt-and-tslib-for-mini2440-and-run-a-demo-app/



  • I guess there might be some similarities but tslib looks like special enough case http://doc.qt.digia.com/qt/qt-embedded-pointer.html to be worth documented. DB client shouldn't be problematic - the only problem in your current workflow I see currently is that you have downloaded armel library from internet. I'm not sure what's your next problem (if library was found) but the only way to solve this for you by solving problem one-by-one until you succeed.



  • I tried to set config.tests/unix/ibase/ibase.pro into
    LIBS += -/fbc/usr/lib/arm-linux-gnueabi

    and I ran this configuration:

    ./configure -embedded arm -prefix /ext -xplatform qws/linux-arm-gnueabi-g++ -no-qt3support -qt-sql-ibase -v -no-webkit -no-phonon -I/fbc/usr/include/

    And it actually enabled interbase as a plugin and enabled me to makefile and make install Qt.

    Now, I've already compiled my code without getting any errors. and then I transferred all the libraries and all the necessary files that I think the embedded control board is needed. But when I ran the executable file on the device. it say's:

    QSqlDatabase: QIBASE driver not loaded
    QSqlDatabase: available drivers: QSQLITE

    NOTE:
    "executable file type: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped"

    I have a question regarding of what I do not know. what is the purpose
    and importance of "-l" in the "LIBS += -lfbclient" and does not getting any error while configuring Qt assures that it is successful?



  • When you build app process takes two steps:

    1. compile (convert source code files to object files)
    2. linking (combine object files and libraries into executable or library).

    "LIBS +=" basically lists libraries that must be linked into executable. If you will skip necessary library it should give you linking error and complain (try it). If it is successful everything is OK (I think). It is hard to say why it is not working - I have never compiled custom DB plugin myself. I can guess only: it is looking for DB plugin in wrong place, it fails to load plugin because of some random error (e.g. expects some other library, like glib, not enough memory or anything else). You might try catching problems like this using gdb but that might too advanced at this stage.

    For now here is something I have found and I think might be useful for you:
    http://qt-project.org/doc/qt-4.8/sql-driver.html



  • I am trying an alternative to connect firebird with Qt. but I still encountering a problem. I am trying to use IBPP (interbase ++).

    Here is my Qt with IBPP code:

    #include "/ibpp/core/ibpp.h"
    #include <iostream>
    #include <QApplication>
    #include <QtSql>
    #include <QDebug>
    #include <string>

    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);

    IBPP::Database ibpp = IBPP::DatabaseFactory("localhost","/db.fdb","SYSDBA","masterkey");
    ibpp->Connect();
    
    return a.exec(&#41;;
    

    }

    But there are 3 issues:

    /home/esn/SQSP/sqs-build-Desk2-Release/main.o:-1: In function `IBPP::DatabaseFactory(std::string const&, std::string const&, std::string const&, std::string const&)':

    /ibpp/core/ibpp.h:874: error: undefined reference to `IBPP::DatabaseFactory(std::string const&, std::string const&, std::string const&, std::string const&, std::string const&, std::string const&, std::string const&)'

    :-1: error: collect2: error: ld returned 1 exit status



  • Here you are missing libraries. ld is GNU linker (type "man ld" in terminal). You should add appropriate libraries to LIBS += ...



  • I feel dizzy this time, I think I need to rest now. I'll try to come back here tomorrow. daliusd, Thank you very much.



  • I cannot execute this tutorial completely on how to Make Qt applications work with Firebird database: http://rongsheng007.wordpress.com/2010/08/23/make-qt-applications-work-with-firebird-database/

    Can somebody test it and tell me if it is working? thanks



  • Nico, try contacting person who wrote that article. He/She might help you more than us.



  • ok, thanks daliusd! :)



  • I'm trying to do this but I can not also
    IBBP also uses tried but did not work



  • Please advise if you find something,
    I used that example but giving this error with memset and memcpy
    anyone have any idea what it might be?
    I'm using Qt 5.2 ....
    will these functions were taken?
    never used them ...



  • Oh, this is a long time ago. I'd able to make Firebird to work in Qt running over a ARM architecture microcontoller by switching from Angstrom distribution to Ubuntu distribution.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.