code blocks IDE

I just wanted to get everyones opinion on code blocks IDE. I decided to try it out because I was using Microsoft Visual c++ express and it kept allowing me to use all kinds of functions without including the appropriate header file. while this might sound good at first it really turns out to be a bad thing. especially if your posting code because it will work for you but no one else. I also experienced some weirdness with the microsoft compiler and namespaces. basically it was allowing you to declare namespaces to functions that are not part of that namepsace.

so far the code blocks IDE has been great. plus I dont even have to do anything special to keep my consoles open. overall everything looks good so i just wanted to see what others thought or if there is something with this IDE i have to be aware of. If i get into templates will this gcc compiler work with them?
I love Code::Blocks personally. GCC will do anything in the standard library, so no worries =)
closed account (yAqiE3v7)
I like Dev C++ Bloodshed better.
g++ is an excellent compiler, and is a default choice on many Unix-like systems. It's not strictly standards compliant either, but unlike the Microsoft compiler (as far as I know) you can force it to be with the -pedantic flag.

EDIT: FidgityParseLanguage? Say... I know who you are...

-Albatross
Last edited on
closed account (yAqiE3v7)
I think I remember you too, Albatross.
I tried out wxDev-C++ and seemed to run into the same problems yet requiring slightly different fixes on both (meaning Dev-C++)... I don't think they really changed it much, but it is a little better. I can see why people like it, but I like Code::Blocks better. I did find that there is more different with MinGW (with the win32 binaries for g++) than g++ on a linux box then they let on, but you don't really run into that prob until you go deeper. Mostly it's just little things though (well, so far). Maybe it's code::blocks, but I don't always check the compile commands like I should... That's a problem with using a GUI.

Either way, I am starting to like Code::Blocks. I have the portable (beta) version also so that I can use it on this computer, but it's kind of choppy... that might be because of the stick or because it's beta... haven't really checked it out fully. I think it might just be a few settings I have off or soemthing... either way, I like having crap on a jump drive. I feel really nerdy... What kind of pocket protector should you get for an IDE and compiler in the pocket?
Last edited on
I have Dev-C++, Code::Blocks, and VC++ 2010 installed on my computer, and have used them a lot. Code::Blocks is by far the best IDE of the three. Dev-C++ is HORRIBLE with non-standard libraries, it is a pain to get them linked and working right. VC++ 2010 has odd project settings that don't allow other people to run win32 applications by default, never found out how to get it to work =/. But VC++ 2010 does have a lot of useful features and options. Code::Blocks is more user friendly, has all the needed features and options, and is VERY easy to get used to. Also Code::Blocks has all of its options and settings in a very neat and nice way, anyone can find any option with ease.
closed account (yAqiE3v7)
Great site for beginners. :)
thecodewall, Why did you post that?
I love C::B!
Along with Qt Creator for GUIs it's my favourite IDE !
xander333, could you tell me how to setup the Qt4.7.1 with code blocks 10.05?
my OS is windows xp sp3
my gcc is tdm-gcc-4.5.1

I run the examples of C++ GUI Programming with Qt4, sec edition
it always give me error messages like

undefined reference to 'vtable for findDialog'
undefined reference to `FindDialog::staticMetaObject'


The example of chapter1 of this book could be compiled perfectly, but the example of
the chapter2 can't work at all.

below is the example which always give me errors message(from chapter 2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef FINDDIALOG_H
#define FINDDIALOG_H

#include <QDialog>

class QCheckBox;
class QLabel;
class QLineEdit;
class QPushButton;

class FindDialog : public QDialog
{
    Q_OBJECT

public:
    FindDialog(QWidget *parent = 0);

signals:
    void findNext(const QString &str, Qt::CaseSensitivity cs);
    void findPrevious(const QString &str, Qt::CaseSensitivity cs);

private slots:
    void findClicked();
    void enableFindButton(const QString &text);

private:
    QLabel *label;
    QLineEdit *lineEdit;
    QCheckBox *caseCheckBox;
    QCheckBox *backwardCheckBox;
    QPushButton *findButton;
    QPushButton *closeButton;
};

#endif 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <QtGui>

#include "finddialog.h"

FindDialog::FindDialog(QWidget *parent)
: QDialog(parent)
{
    label = new QLabel(tr("Find &what:"));
    lineEdit = new QLineEdit;
    label->setBuddy(lineEdit);

    caseCheckBox = new QCheckBox(tr("Match &case"));
    backwardCheckBox = new QCheckBox(tr("Search &backward"));

    findButton = new QPushButton(tr("&Find"));
    findButton->setDefault(true);
    findButton->setEnabled(false);

    closeButton = new QPushButton(tr("Close"));

    connect(lineEdit, SIGNAL(textChanged(const QString &)),
            this, SLOT(enableFindButton(const QString &)));
    connect(findButton, SIGNAL(clicked()),
            this, SLOT(findClicked()));
    connect(closeButton, SIGNAL(clicked()),
            this, SLOT(close()));

    QHBoxLayout *topLeftLayout = new QHBoxLayout;
    topLeftLayout->addWidget(label);
    topLeftLayout->addWidget(lineEdit);

    QVBoxLayout *leftLayout = new QVBoxLayout;
    leftLayout->addLayout(topLeftLayout);
    leftLayout->addWidget(caseCheckBox);
    leftLayout->addWidget(backwardCheckBox);

    QVBoxLayout *rightLayout = new QVBoxLayout;
    rightLayout->addWidget(findButton);
    rightLayout->addWidget(closeButton);
    rightLayout->addStretch();

    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addLayout(leftLayout);
    mainLayout->addLayout(rightLayout);
    setLayout(mainLayout);

    setWindowTitle(tr("Find"));
    setFixedHeight(sizeHint().height());
}

void FindDialog::findClicked()
{
    QString text = lineEdit->text();
    Qt::CaseSensitivity cs =
            caseCheckBox->isChecked() ? Qt::CaseSensitive
                                      : Qt::CaseInsensitive;
    if (backwardCheckBox->isChecked()) {
        emit findPrevious(text, cs);
    } else {
        emit findNext(text, cs);
    }
}

void FindDialog::enableFindButton(const QString &text)
{
    findButton->setEnabled(!text.isEmpty());
}


Thanks a lot

cool thanks guys. i did look at dev c++ but it didnt interest me. codeblocks works great for me so far. i just didnt want any surprises. but it sounds like there isnt many so.

sorry stereomatching im just using standard c++ no other APIs so I dont know anything about the qt library. maybe if you make a separate thread you may get more answers.

don't mind, I solved the problem already


<QT4 directory>\bin\moc.exe myfile.h -o moc_myfile.cpp
Then include the file moc_myfile.cpp in the project as well.


Looks like some IDE would do this automatically for you but code blocks::10.05 wouldn't
How could I make the IDE do this automatically for me?
Thanks
Topic archived. No new replies allowed.