User forums > Help
[Solved *Really] CodeBlock can't find QT4 libs
sqlpython:
Arrggghhh
Spoke too soon!!
Seems that the User Launched version of CodeBlocks cannot First Compile the Project..
If the Project is first Built by the root launched version then the user launched version can later Build/Run the projects. However if Rebuilt by the User launched version the same problems as the above log ensue..
Any Thoughts?
MortenMacFly:
No code, no help. However, this:
--- Quote from: sqlpython on March 05, 2012, 05:13:45 am ---
--- Code: ----------------- Build: Debug in QtFixed ---------------
g++ -Wall -g -I/usr/include -I/usr/include/QtGui -c /home/sqlpython/.codeblocks/Projects/QtFixed/QtFixed/main.cpp -o obj/Debug/main.o
--- End code ---
--- End quote ---
..doesn't look good to me. -I/usr/include/QtGui should not be needed.
As I still don't fully understand your system layout (did you really install the QT-DEV package?) its hard to suggest any setup.
Why don't you first try to compile on the command line and then transfer to the IDE? Notice that you also don't need to use global variables - if they are too hard to understand in the first place, just include what's needed as usual, using the path directly in the compiler/linker options.
Notice that here:
http://wiki.codeblocks.org/index.php?title=Global_compiler_variables
...and here:
http://www.codeblocks.org/docs/main_codeblocks_en3.html#x3-1020003.7
...you'll find more information.
sqlpython:
Thanks for your input....
This is a bit frustrating...Please be aware that I am an IDE user since 1985 beginning with my Days using Borland products..
I have never to my memory ever had problems installing compiler dir lib location in Windows nor Linux.
....Currently I can run the same code in QtCreator as well as Codelite without issue..
Also I can convert the code with pyuic and then run against the same lib with PyQt in Eric and Spyder IDEs w/o issue..
.....only Code::Blocks rejects the paths...and or libs as User yet works as Root/Super user..
Anyhow, I completely uninstalled Code::BLocks cleaned out dirs and Reinstalled Code::Blocks.....
Once again entered my References to the Compiler directive for the $(#qt) variable...
as above the same directories...
So I started the Default QT project via the Wizard..
All went well until the compile...
Code::Blocks now throws up errors by opening up the config file in the Qt lib sub dir...
It reads the file in the QtGui /include/QtGui/ dir
This runs an if clause which runs through the dir contents as Check of contents to present the libs to compiler inquiries..
It begins like so.... and goes on to run through the contents of the dir...
There are 18 Qt sub dir and each one has one of these ref files
--- Code: ---#ifndef QT_QTGUI_MODULE_H
#define QT_QTGUI_MODULE_H
#include <QtCore/QtCore>
#include "qabstractitemdelegate.h"
#include "qabstractitemview.h"
#include "qabstractproxymodel.h"
--- End code ---
This file is then opened on the editor next to main.cpp..
and an error is throw on the 3rd line not finding <QtCore/QTCore> as a dir so I tried <QtCore> as the second item is a file not a dir... But no help then drills into the qcoreapplication.h and disagrees with some contents there.... [out of breath]
I am about read to accept that Code::Blocks is not Qt4 compatible.. I have searched the forums here and I see Qt4 setup issues going back to at least 2006 without any satisfactory solution..
Here is my dir tree if it gives you any ideas...
Thanks for patience...
--- Code: ---sqlpython@debian7:/usr/share/qt4$ ls
bin include phrasebooks q3porting.xml translations
doc mkspecs plugins QtCore
sqlpython@debian7:/usr/share/qt4$ tree -d /usr/share/qt4/include
/usr/share/qt4/include
├── Qt
├── Qt3Support
├── QtCore
├── QtDBus
├── QtDeclarative
├── QtDesigner
├── QtGui
├── QtHelp
├── QtNetwork
├── QtOpenGL
├── QtScript
├── QtScriptTools
├── QtSql
├── QtSvg
├── QtTest
├── QtUiTools
├── QtWebKit
├── QtXml
└── QtXmlPatterns
19 directories
sqlpython@debian7:/usr/share/qt4$ tree -d /usr/include/qt4
/usr/include/qt4
├── Qt
├── Qt3Support
├── QtCore
├── QtDBus
├── QtDeclarative
├── QtDesigner
├── QtGui
├── QtHelp
├── QtNetwork
├── QtOpenGL
├── QtScript
├── QtScriptTools
├── QtSql
├── QtSvg
├── QtTest
├── QtUiTools
├── QtWebKit
├── QtXml
└── QtXmlPatterns
--- End code ---
scarphin:
The solution I use for Qt4 is to adjust the priority of compilation. Every header file containing the Q_OBJECT macro has to have a higher priority of compilation with the moc compiler and then u can include the 'moc.cpp' file in the corresponding .cpp file. That works for me.
sqlpython:
Thanks for your Input that can work.....
But...
We FINALLY have automated the solution Globally.....
Working with my Brother my fellow programmer he has come upon the method to GLobally declare a series of Dirs that will work when Code::Blocks is run as USER...
He Has been working day and Night to come upon the solution but during this time his Wife and Children have left him!!!!
(However he now has Peace and Quiet)
This is the Global automated solution add to Compiler Search Global All QT dirs and /usr/share/qt4/include.....
Anyway the solution turned out to be to start CodeBlocks and go to Menus
Settings -> Compiler Debugger Settings -> Global Compiler Settings -> [Search Dir] Tab -> [Compiler] subTab
.......And ADD the following dir to search
although the last 18 are sub dir of the 1st they must each be listed manually for this to work as well as /usr/share/qt4/include...
Also recommend that you modify the Global Variable as follow
I just had to find the correct combination of dirs referenced by variable qt4
In the Code::Blocks Settings -> Globalvariables
Choosing to effect in the pop up window the variable qt4
I list the dirs this way...which compiles and works
the dirs are added this way including quotes " "
Remember all that read this my qt4 deb installed to /usr/share/qt4/
base "/usr"
include "/usr/share/qt4/include"
lib "/usr/lib"
obj "/usr/bin"
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version