Code::Blocks
November 22, 2014, 12:53:37 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The new Release 13.12 is out! You can download binaries for windows, mac and many major linux distros from  http://www.codeblocks.org/downloads/26 .
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: C::B + QT4  (Read 10349 times)
dr23
Guest
« on: September 25, 2006, 11:23:55 pm »

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
Logged
David Perfors
Developer
Lives here!
*****
Offline Offline

Posts: 560


« Reply #1 on: September 26, 2006, 10:11:32 am »

Did you search the Build options? There you will find the includes (second tab)
Logged

OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring
dk
Advanced newcomer
*
Offline Offline

Posts: 55


WWW
« Reply #2 on: September 26, 2006, 04:42:33 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.
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>                       
Logged

Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)
MortenMacFly
Administrator
Lives here!
*****
Offline Offline

Posts: 8687



« Reply #3 on: September 26, 2006, 05:19:25 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");
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.
Logged

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ
dk
Advanced newcomer
*
Offline Offline

Posts: 55


WWW
« Reply #4 on: September 26, 2006, 05:45:54 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.

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"?
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
Logged

Denis Kirienko
C::B maintainer for ALT Linux distribution (http://www.sisyphus.ru/srpm/codeblocks)
Methedrine
Advanced newcomer
*
Offline Offline

Posts: 11

Wearing Cheap Shades


« Reply #5 on: September 26, 2006, 07:47:29 pm »


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.

IIRC the unix convention is to put the 4 into the path (f.e. /usr/lib/qt4), and the windoze one is adding it to the filename (i.e. qtgui4.dll)
Logged

Some people get by with a little understanding, some people get by with a whole lot more ...
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!