PDA

View Full Version : how config Codeblocks on linux ?



Skowroniasty
14th November 2009, 15:20
Hi,
Im trying write simple GUI apps using Qt (2009.04) on linux (ubuntu),
for start learning I want use some "raw" IDE, so i choice codeblocks.
When I starting create GUI apps project on C::B, on wizard im set path to QT installation directory. (/opt/qt-sd ....), and for moment - when I create my SLOTs all be fine (i can use, label, button etc.), but when i create my slots i have still this error :
/home/user/dev/QVin/MyWindow.cpp|37|undefined reference to `vtable for MyWindow'|
On windows for resolve this error (on DEVC+ Qt) must copy file qt-moc-ui-rcc.exe and qt.mak to devC bin folder, but how resolve this problem on linux and codeblocks?

I can't search answer for my question on codeblocks, because for now, www.codeblocks.org is disable :/


my header file:



#include <QtGui>
#ifndef _MYWINDOW_H_
#define _MYWINDOW_H_

class MyWindow: public QMainWindow
{
Q_OBJECT

public:
MyWindow();
~MyWindow();
private:
QMenu *filemenu;
QMenu *about;
// QToolBar *toolBar;

QAction *fileOpen;
QAction *fileSave;
QAction *appExit;

private slots:
void Open();
void Save();
};


#endif

squidge
14th November 2009, 16:34
Does your makefile include running MOC on this headerfile and including the resulting output in your files to be compiled?

fauconbleu
29th October 2010, 15:44
This page describes how to do it on ubuntu, but it's the same for all linux versions.
Besides, you can use symbolic links instead or copying files like mentionned in the tutorial.
http://www.amazing-tutorials.com/qt/configure-qt-with-code-block/

gboelter
29th October 2010, 17:45
Had these problem too many times and normaly it's the problem with creating moc files.

The easiest way is to use Code::Blocks as an editor, then switch with alt->tab to an open terminal window and then call 'make'. It's even faster then using code::blocks for building the application.