User forums > Help
C::B + QT4
dr23:
Hi,
I would like to start a software but using c::B
I'm on Kubuntu Dapper and download the last nightly built. Don't tell me bugs could appears... I know.
But I chose a empty projet because when i select QT4 project it say that c:b can't find Qt4core Lib whereas QT4 is successfuly installed.
But i would like to add QT include in order to have completion code.
How i do that ? I searched in Project Properties but i did not find something like "include".
Thaks for help
David Perfors:
Did you search the Build options? There you will find the includes (second tab)
dk:
--- Quote from: dr23 on September 25, 2006, 11:23:55 pm ---But I chose a empty projet because when i select QT4 project it say that c:b can't find Qt4core Lib whereas QT4 is successfuly installed.
--- End quote ---
QT4 Wizard doesn't work fine in Linux. You should configure QT4 Wizard for your system.
Edit files /usr/share/codeblocks/templates/qt.cbp and /usr/share/codeblocks/templates/wizard/qt4/wizard.script
You should set correct filenames for .a libraries and correct path to QT4 directory.
For example, I've used the next patch for my system (ALT Linux Sisyphus):
--- Code: ------ codeblocks-1.0/src/plugins/scriptedwizard/resources/qt4/wizard.script.orig 2006-08-28 14:49:50 +0400
+++ codeblocks-1.0/src/plugins/scriptedwizard/resources/qt4/wizard.script 2006-08-28 14:51:41 +0400
@@ -5,10 +5,10 @@
////////////////////////////////////////////////////////////////////////////////
// globals
-QtPathDefault <- _T("$(#qt)");
-QtPathDefaultInc <- _T("$(#qt.include)");
-QtPathDefaultLib <- _T("$(#qt.lib)");
-QtPath <- _T("");
+QtPathDefault <- _T("/usr/lib/qt4");
+QtPathDefaultInc <- _T("/usr/lib/qt4/include");
+QtPathDefaultLib <- _T("/usr/lib/qt4/lib");
+QtPath <- _T("/usr/lib/qt4");
function BeginWizard()
{
@@ -52,7 +52,7 @@
local dir_nomacro_lib = GetCompilerLibDir(dir, QtPathDefault, QtPathDefaultLib);
if (dir_nomacro_lib.IsEmpty())
return false;
- if (!VerifyLibFile(dir_nomacro_lib, _T("QtCore4"), _T("Qt's"))) return false;
+ if (!VerifyLibFile(dir_nomacro_lib, _T("QtCore"), _T("Qt's"))) return false;
QtPath = dir; // Remember the original selection.
@@ -93,8 +93,8 @@
project.AddLibDir(QtPathDefaultLib);
// add link libraries
- project.AddLinkLib(_T("QtCore4"));
- project.AddLinkLib(_T("QtGui4"));
+ project.AddLinkLib(_T("QtCore"));
+ project.AddLinkLib(_T("QtGui"));
// enable compiler warnings (project-wide)
WarningsOn(project, Wizard.GetCompilerID());
--- codeblocks-1.0/src/templates/common/qt.cbp.orig 2006-08-28 11:46:22 +0400
+++ codeblocks-1.0/src/templates/common/qt.cbp 2006-08-28 14:23:10 +0400
@@ -32,17 +32,13 @@
<Add option=""/>
</Compiler>
<Linker>
- <Add library="libQt3Support4.a"/>
- <Add library="libQtAssistantClient.a"/>
- <Add library="libQtCore4.a"/>
- <Add library="libQtDesigner4.a"/>
- <Add library="libQtDesignerComponents4.a"/>
- <Add library="libQtGui4.a"/>
- <Add library="libqtmain.a"/>
- <Add library="libQtNetwork4.a"/>
- <Add library="libQtOpenGl4.a"/>
- <Add library="libQtSql4.a"/>
- <Add library="libQtXml4.a"/>
+ <Add library="libQt3Support.a"/>
+ <Add library="libQtCore.a"/>
+ <Add library="libQtGui.a"/>
+ <Add library="libQtNetwork.a"/>
+ <Add library="libQtOpenGl.a"/>
+ <Add library="libQtSql.a"/>
+ <Add library="libQtXml.a"/>
<Add directory="$QTDIR/lib"/>
<Add option=""/>
</Linker>
--- End code ---
MortenMacFly:
--- Quote from: dkirienko on September 26, 2006, 04:42:33 pm --- // globals
-QtPathDefault <- _T("$(#qt)");
-QtPathDefaultInc <- _T("$(#qt.include)");
-QtPathDefaultLib <- _T("$(#qt.lib)");
-QtPath <- _T("");
+QtPathDefault <- _T("/usr/lib/qt4");
+QtPathDefaultInc <- _T("/usr/lib/qt4/include");
+QtPathDefaultLib <- _T("/usr/lib/qt4/lib");
+QtPath <- _T("/usr/lib/qt4");
--- End quote ---
This (and a few other things) I don't like. The above will work if you define qt as global variable. But with your patch applied it's of very limited functionality. But this won't work on any other system where e.g. the libs are not under /usr/lib/qt4 (and there are many of those) and for sure not on Windows. That's why you define it as global variable - a user can then choose where the libs are on it's particular system independent of the OS.
In addition: Did you notice that this is a qt4 wizard? Correct me, if I'm wrong, but isn't there the lib name with a "4"?
With regards, Morten.
dk:
--- Quote from: MortenMacFly on September 26, 2006, 05:19:25 pm ---This (and a few other things) I don't like. The above will work if you define qt as global variable. But with your patch applied it's of very limited functionality. But this won't work on any other system where e.g. the libs are not under /usr/lib/qt4 (and there are many of those) and for sure not on Windows. That's why you define it as global variable - a user can then choose where the libs are on it's particular system independent of the OS.
--- End quote ---
Yes, of course! But this patch was made only for my favorite Linux distribution. And now you may find the rpm with this patch in the ALT Linux sisyphus repository. I don't plan to use it at the other systems. So, it is more easy to set absolute path to QT4 dir, than defining system-wide variable.
--- Quote ---In addition: Did you notice that this is a qt4 wizard? Correct me, if I'm wrong, but isn't there the lib name with a "4"?
--- End quote ---
In my distribution there are no suffixes "4" in QT4 library names:
--- Code: ---$ ls /usr/lib/qt4/lib/*.a
/usr/lib/qt4/lib/libQt3Support.a /usr/lib/qt4/lib/libQtNetwork.a /usr/lib/qt4/lib/libQtSvg.a
/usr/lib/qt4/lib/libQtCore.a /usr/lib/qt4/lib/libQtOpenGL.a /usr/lib/qt4/lib/libQtXml.a
/usr/lib/qt4/lib/libQtGui.a /usr/lib/qt4/lib/libQtSql.a
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version