PDA

View Full Version : Error after trying to run project in UBUNTU



sincnarf
5th October 2007, 04:33
I started my project using windows and it compiles and runs without errors.

I am currently trying to run my project under ubuntu feisty fawn. There seem to be an error when I am trying to run my prject. on executing my project, my mainwindow does not show at all and I get an error (Segmentation fault (core dumped)) error. I used gdb for debugging and here's what I get.



Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) start
Breakpoint 1 at 0x8050f65: file main.cpp, line 9.
Starting program: /home/sicnarf/Dokymentos/IADFUQ/SP/SP
[Thread debugging using libthread_db enabled]
[New Thread -1222629680 (LWP 7316)]
[Switching to Thread -1222629680 (LWP 7316)]
main (argc=1, argv=0xbfce54d4) at main.cpp:9
9 Q_INIT_RESOURCE(resources);



Whenever I try to rebuild my project I use the ff. procedure
make clean
qmake -config debug
make

Line 9 is defined here


#include "mainwindow.h"
#include <QtPlugin>
#include <QApplication>

Q_IMPORT_PLUGIN(pnp_basictools)

int main(int argc, char *argv[])
{
/*Line 9---> */ Q_INIT_RESOURCE(resources);
QApplication app(argc, argv);
MainWindow window;
window.show();
return app.exec();
}


here's my qrc file


<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/">

<file>images/IADFUQ.png</file>
<file>images/add.png</file>
<file>images/circle.png</file>
<file>images/copy.png</file>
<file>images/cut.png</file>
<file>images/delete.png</file>
<file>images/fitToView.png</file>
<file>images/help.png</file>
<file>images/new.png</file>
<file>images/open.png</file>
<file>images/parameter.png</file>
<file>images/paste.png</file>
<file>images/plugin.png</file>
<file>images/print.png</file>
<file>images/qt-logo.png</file>
<file>images/redo.png</file>
<file>images/save.png</file>
<file>images/star.png</file>
<file>images/storeTo.png</file>
<file>images/trash.png</file>
<file>images/undo.png</file>
<file>images/viewer.png</file>
<file>images/star.png</file>
</qresource>
</RCC>



All the images under this qrc exist in the my images folder.

sincnarf
5th October 2007, 05:29
I've Commented line 9

Q_INIT_RESOURCE(resources);

Now I get an error at the next line which is
QApplication app(argc, argv);



(gdb) start
Breakpoint 1 at 0x8050967: file main.cpp, line 10.
Starting program: /home/sicnarf/Dokymentos/IADFUQ/SP/SP
[Thread debugging using libthread_db enabled]
[New Thread -1222580528 (LWP 6841)]
[Switching to Thread -1222580528 (LWP 6841)]
main (argc=1, argv=0xbfe2d624) at main.cpp:10
10 QApplication app(argc, argv);
(gdb) backtrace
#0 main (argc=1, argv=0xbfe2d624) at main.cpp:10

What is wrong with this? T_T