User forums > Using Code::Blocks
Using Qt
TDragon:
--- Quote from: bfr on June 11, 2007, 10:00:43 pm ---I think I have to download the Code::Blocks source...?
--- End quote ---
And compile it, I imagine. You'll also need to ensure that the QtWorkbench project can find it, either by global variable or by being in the correct location relative to C::B's source. (Check the build options to see which include path references the C::B sources.)
WhiteStarLine:
Hi guys,
I migrated from DEV-CPP a few months ago and could not get QT 4.0 to compile with C::B 1.0RC2, no matter what I tried (or Googled). I ended up using C::B not as an IDE but as a C++ editor, then used the Trolltech qmake command line to compile.
Last night I uninstalled C::B 1.0RC2, then downloaded Qt 4.3.0, took the MinGW option and then the 12 June nightly build. On loading C::B for the first time, I selected a new QT project and pointed to C:\Qt\4.3.0 as my QT directory, with the 'bin' and 'lib' directories.
The new QT project wizard loaded main.cpp with the correct QT 4 syntax and it compiled immediately and generated the correct GUI executable. I did nothing other than selected the standard options - no work arounds or modifications.
Thanks team, Code:: Blocks is a wonderful product.
*****************
Post edit: Once I tried any QT code requiring Q_OBJECT, C::B would not compile it, reporting the same error messages others have. I tried QT Workbench and put in every project option but it seems hard coded to an earlier QT version (or, you need to download the C::B source and build it yourself). Eventually I downloaded another IDE, which seems to work perfectly. I'll give C::B another go later with the QT workbench as I appreciate the amount of effort that is going into the project.
bfr:
WhiteStarLine, try using the latest Nightly build of Code::Blocks instead of RC2 for starters. Then, try the QtWorkbench plugin.
And although using these will help, I still haven't gotten it to work. Oh, and reading some of the previous posts in this topic might be helpful too.
bfr:
I've been trying for quite a while to get Qt to fully work. It works...until I use stuff like Q_OBJECT, which makes me get:
--- Code: ---obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x164):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x263):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x3c8):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x4e9):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x5f3):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x4ef4):: undefined reference to `vtable for MainWindow'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x4efb):: undefined reference to `vtable for MainWindow'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x4fd1):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x5241):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x5299):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x5554):: undefined reference to `vtable for MainWindow'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x555b):: undefined reference to `vtable for MainWindow'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x5631):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x58a1):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\mainwindow.o:mainwindow.cpp:(.text+0x58f9):: undefined reference to `MainWindow::staticMetaObject'
obj\Release\main.o:main.cpp:(.text+0xd9):: undefined reference to `vtable for MainWindow'
obj\Release\main.o:main.cpp:(.text+0xe7):: undefined reference to `vtable for MainWindow'
obj\Release\main.o:main.cpp:(.text+0x15f):: undefined reference to `vtable for MainWindow'
obj\Release\main.o:main.cpp:(.text+0x164):: undefined reference to `vtable for MainWindow'
:: === Build finished: 19 errors, 0 warnings ===
--- End code ---
I have the latest version of the QtWorkBench plugin. I have the June 28th build of Code::Blocks.
WhiteStarLine: What IDE did you end up getting?
yop:
Please follow the instructions on installing and using the plugin:
http://code.google.com/p/qtworkbench/wiki/PluginInstallation
http://code.google.com/p/qtworkbench/wiki/PluginUsage
The core of the plugin has been rewritten and it is working like expected in most cases. Previous versions were actually based on hackish code that were useful to me but couldn't stand as a stand alone plugin. The current implementation on the other hand is meant to be the default solution for using Qt in Code::Blocks. What I am doing now is getting feddback from plugin users on defects and on how we can make it better. You can also help by submiting your thoughts in the issue tracker. Besides that I am still refactoring the core of the plugin, working in the flexibility of the parser and I hope that I find the time to prepare a project generation wizard as the creation of QtWorkbench projects requires quite a few steps to start up and prepare. You will not see anything impresive in the next few versions of the plugin regarding new features, but stability and hopefully better user experience through automatic C::B project and target generation.
If although you have followed the steps described in the plugin usage pages you can't get it to work please report your problems here or in the plugin site. Oh, and as a side note you don't have to build the plugin yourself anymore if you 're using MS Windows and a recent C::B nightly build.
Navigation
[0] Message Index
[*] Previous page
Go to full version