I Need help in cross compiling Qt with firebird step by step
-
wrote on 8 Jan 2013, 00:58 last edited by
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
-
wrote on 8 Jan 2013, 06:15 last edited by
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.
-
wrote on 10 Jan 2013, 11:17 last edited by
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.
-
wrote on 10 Jan 2013, 11:29 last edited by
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.
-
wrote on 10 Jan 2013, 12:30 last edited by
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/
- libfbclient.so
- libfbclient.so.2
- libfbclient.so.2.5.0
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. -
wrote on 10 Jan 2013, 12:34 last edited by
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.
-
wrote on 10 Jan 2013, 12:55 last edited by
hmmm. I still have no luck cross compiling Qt with interbase enabled. thanks again daliusd.
-
wrote on 10 Jan 2013, 13:09 last edited by
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/
-
wrote on 10 Jan 2013, 13:23 last edited by
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.
-
wrote on 10 Jan 2013, 14:35 last edited by
I tried to set config.tests/unix/ibase/ibase.pro into
LIBS += -/fbc/usr/lib/arm-linux-gnueabiand 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: QSQLITENOTE:
"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? -
wrote on 10 Jan 2013, 14:50 last edited by
When you build app process takes two steps:
- compile (convert source code files to object files)
- 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 -
wrote on 10 Jan 2013, 15:12 last edited by
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();
}
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
-
wrote on 10 Jan 2013, 15:23 last edited by
Here you are missing libraries. ld is GNU linker (type "man ld" in terminal). You should add appropriate libraries to LIBS += ...
-
wrote on 10 Jan 2013, 15:38 last edited by
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.
-
wrote on 11 Jan 2013, 06:07 last edited by
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
-
wrote on 12 Jan 2013, 10:45 last edited by
Nico, try contacting person who wrote that article. He/She might help you more than us.
-
wrote on 14 Jan 2013, 01:35 last edited by
ok, thanks daliusd! :)
-
wrote on 2 Dec 2013, 13:25 last edited by
I'm trying to do this but I can not also
IBBP also uses tried but did not work -
wrote on 3 Dec 2013, 11:23 last edited by
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 ... -
wrote on 8 Dec 2013, 15:16 last edited by
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.