Author Topic: QtWorkbench plugin  (Read 254519 times)

Methedrine

  • Guest
Re: QtWorkbench plugin
« Reply #105 on: November 01, 2006, 12:58:43 pm »
Hi, I'm pretty new to programming and I would like to learn via Qt and Code::Blocks.
I'm trying to build the files for the Qtworkbench plugin, but I'm getting build errors, where it says that it can't find certain header files, such as
#include <sys/utsname.h>
#endif
#include <wx/tokenzr.h>
#include <sdk.h>

#include <settings.h>
#include <cbproject.h>
#include <compiler.h>
#include <wx/dir.h>

etc.

Sorry, I'm pretty green, but I'd appreciate the help.  What am I doing wrong and how do I config Code::Blocks to load the files?

Thanks

Adam

You have to make sure that your include paths are correct and contain the files listed above. Apart from that, however, it is unlikely that QtWorkbench will compile because codeblock's plug-in interface recently changed.

zithen

  • Guest
Re: QtWorkbench plugin
« Reply #106 on: November 02, 2006, 04:41:25 am »
Hi,

I appreciate you answering my question.  Since I'm new to all this, I having trouble finding out how to set these files.  How do you set up the include files in code::blocks?  I'm using Windows.

Thanks again...

Adam

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #107 on: November 04, 2006, 03:52:36 pm »
Hi zithen,
did you use the provided code::blocks project or did you try to set up your own? The needed directories are already included in that project file so you shouldn't have to do anything. Also the <sys/utsname.h> is a *nix specific inclusion used to determine what kind of *nix flavor you are running on, it shouldn't be included in a windows compilation. Use the provided project file (qtworkbench.cbp) and it hould compile out of the box. I haven't used windows for quite a while though so I 'm not 100% sure that it will but I can take a look at it and get back to you.

Generally for the plugin, I tried to use the actual qmake sources for the parser but I have to reinvent the wheel in many cases (provide a hash table, directory browser, regular expressions etc) that are already there and provided for Qt, so I kind of gave up on the thought and returned to the one I had about using a lexer/parser. I am really stressed at work (and it seems that this will be the case until Christmas) so I don't really know when I 'll be able to pick it up again...
Life would be so much easier if we could just look at the source code.

Offline Sepidar

  • Single posting newcomer
  • *
  • Posts: 3
Re: QtWorkbench plugin
« Reply #108 on: November 15, 2006, 06:44:45 am »
hi yop;
after reading all of discussions you made, at last i could not compile qtworkbench with your plugin. so i want to suggest you a bad-but-working way to solve these build-problems specially for dummies like me: just upload files are needed to install the plugin (DLL, ZIP, setup.bat and etc.).

Thanks

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7683
    • My Best Post
Re: QtWorkbench plugin
« Reply #109 on: November 15, 2006, 04:41:05 pm »
FYI:

The code::blocks SVN 3222 caused an compile issue patch below:

Tim S

PS: If you can NOT compile code::blocks from SVN, do NOT ask me any questions about this patch because you can NOT use this patch without knowing how to compile code::blocks from SVN.

Index: src/qtwprogenerator.cpp
===================================================================
--- src/qtwprogenerator.cpp   (revision 13)
+++ src/qtwprogenerator.cpp   (working copy)
@@ -951,7 +951,7 @@
         DoAddProOptions(TargetProBuffer,target);
         DoAddConfiguration(TargetProBuffer,target);
 
-        Manager::Get()->GetMacrosManager()->ReplaceMacros(TargetProBuffer, true);
+        Manager::Get()->GetMacrosManager()->ReplaceMacros(TargetProBuffer);
 
         wxFile file(TargetProFilenameString, wxFile::write);
         cbWrite(file,TargetProBuffer);
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #110 on: November 15, 2006, 11:28:44 pm »
Thanks build succesfully in svn build rev 3223 (2006-11-15 22:32:19) gcc 4.1.2 Linux/unicode
Updated the svn sources as well.
Life would be so much easier if we could just look at the source code.

Offline joachim

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: QtWorkbench plugin
« Reply #111 on: November 28, 2006, 10:13:42 am »
I have been trying a while to get the QTWorkbench plugin to work for me. Actually the one shot timer in qtworkbench seemed never to trigger and the menu remained grayed out after each compile. The only way to reset (That I could find) was to restart CB.

Anyway, I added the line
    m_Timer.SetOwner(this,idQtWbTimer); just before starting the timer in the OnProcessTerminated method. It actually made things work. :P See excerpt below. I could submit  a patch but it is really only one line to add.

When reading the wxWidgets documentation it seem like that line has to be called in order to direct the timer message.

void QtWorkbench::OnProcessTerminated(CodeBlocksEvent& event)
{
......
......
......
    wxMenuBar* mbar = Manager::Get()->GetAppWindow()->GetMenuBar();
    if (mbar)
    {
        mbar->Enable(idQtWbMenuCompile,false);
        mbar->Enable(idQtWbMenuClean,false);
        mbar->Enable(idQtWbMenuRebuild,false);
        mbar->Enable(idQtWbMenuDistClean,false);
        mbar->Enable(idQtWbMenuCompileWorkspace,false);
        mbar->Enable(idQtWbMenuRebuildWorkspace,false);
        mbar->Enable(idQtWbMenuCleanWorkspace,false);
    }

    m_Timer.SetOwner(this,idQtWbTimer); 
        m_Timer.Start(500,wxTIMER_ONE_SHOT);
}

Br Joachim

W2K, SP4, Compiling Nightly.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #112 on: November 28, 2006, 11:02:56 pm »
OK I commited this and it works, I haven't checked the build process lately and I don't know what has changed but in the make options I had to put a lot of sub-$target-[action] in order to make it build my project.
Life would be so much easier if we could just look at the source code.

Offline joachim

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: QtWorkbench plugin
« Reply #113 on: December 04, 2006, 08:13:30 pm »
Yes, and without the timer triggering, there was a lot of sub-sub-sub.... built up in the make command. Having passed that we have the next issue. I cannot debug. Actually, the debug command from the menu will first try to build using the regular make. This fails and debug is aborted. (I havent understood why it fails but it does complain about unexpected end of file) I wonder if there is a need to add a QTWorkBench debug command....

BUILD LOG:
/bin/sh: -c: line 2: syntax error: unexpected end of file
cd Debug && mingw32-make.exe debug
mingw32-make.exe: *** [Release\Makefile] Error 258

c:\devel\mingw\bin\mingw32-make.exe[1]: Entering directory `c:/SW_Dev/qt/Empire/Debug'
c:/devel/mingw/bin/mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[2]: Entering directory `c:/SW_Dev/qt/Empire/Debug'
mingw32-make.exe[2]: Nothing to be done for `first'.
mingw32-make.exe[2]: Leaving directory `c:/SW_Dev/qt/Empire/Debug'
c:\devel\mingw\bin\mingw32-make.exe[1]: Leaving directory `c:/SW_Dev/qt/Empire/Debug'
Process terminated with status 2 (0 minutes, 13 seconds)
0 errors, 0 warnings

DEBUGGER:
Building to ensure sources are up-to-date
Build failed...
Aborting debugging session
 
Br Joachim
W2K, SP4, Compiling Nightly.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #114 on: December 04, 2006, 10:35:48 pm »
I remember putting the sub- in front of the build targets before requesting to build a target but that is not quite enough. The right thing would be a correctly setup project with all the sub-[project]-[action] make targets already in the make commands list. Probably a c::b project template with an initial .pro file, custom makefile build auto selected and a qmake [project name] prebuild step would be quite enough if you can prepare your own .pro files.

The debug and many more issues have to do with the fact that c::b finds relative paths and initiates builds from the top level directory while qmake and make dive into subdirs. If you have many targets then you can' t even click on an error and go to the respective line/file. I guess this issue and possible solutions will be looked into by the c::b team.

As you can see by the activity in the svn this plugin is not one of my top priorities. I have after searching around and trying out stuff pretty much setup my workbench so this is not a necessity to me anymore. I want to pick it up again if I find the time.
Life would be so much easier if we could just look at the source code.

mattie

  • Guest
Re: QtWorkbench plugin
« Reply #115 on: March 13, 2007, 07:22:17 pm »
hi, thank you for this plugin! it does require some effort though for a rookie to get started :)
So I finally got it up and running, but now, when I compile my application, linker complains about not finding qtdesignerd4. Indeed I don't have this file (although I compiled my debug libraries), but why should I? I don't need this DLL and I am compiling a release target anyhow ... :)

and indeed, in the generated .pro file I see:
#Code::Blocks Identifier - START
CONFIG+=    windows uic uitools designer
#Code::Blocks Identifier - END


so I can solve it by appending a line
CONFIG -= designer

but I have the feeling I'm doing something wrong? as I searched the forum and nobody else seems to have this problem..

So I wonder, what am I doing wrong?
Also, I wonder why it seems both debug and release libs are being linked:
g++ -mthreads -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -s -Wl,-subsystem,windows -o "..\bin\Release\PYPicUploader.exe" ..\obj\Release\config.o ..\obj\Release\main.o ..\obj\Release\mainwindow.o ..\obj\Release\moc_mainwindow.o  -L"c:\programs\MinGW\lib" -L"c:\s9\programs\Qt\4.2.0\lib" -L"c:\s9\programs\Qt\4.2.0\lib" -lmingw32 -lqtmaind C:\programs\wxWidgets-2.6.3\lib\gcc_dll\libwxmsw26u.a -lQtCore4 -lQtGui4 -lQtNetworkd4 -lQtDesignerd4 -lQtUiToolsd -lQtXmld4 -lQtGuid4 -lQtCored4
C:\programs\MinGW\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lQtDesignerd4


thanks
matthias

H0LL0

  • Guest
Re: QtWorkbench plugin
« Reply #116 on: May 04, 2007, 01:52:36 am »
hi @ all

i want to use qt under windows and there arent many (cheap ;)) ides offering a good support, c::b seems to be a light in the dark for me ;)

i hope i'm right here. i got a problem installing the plugin. somebody else posted same issue. dont find a solution for me :/

windows, wx 2.8.3 (just compiled!), cb nightly from 1st or 2nd may.

i try to compile qt workbench there comes the following:
Code
:: === QtWorkbench, default ===
ld.exe:: cannot find -lcodeblocks
:: === Build finished: 1 errors, 1 warnings ===

so far so good, so i read somewhere i should recompile code blocks for the libraries.
here i go, and what was there:
Code
:: === Code::Blocks, scintilla ===
ld.exe:: cannot find -lwxmsw28u
:: === Build finished: 1 errors, 0 warnings ===

soooooooooooo the wx variable is set to
base: ... wxWidgets-2.8.3
include: ... wxWidgets-2.8.3\include
lib: ... wxWidgets-2.8.3\lib\gcc_lib
(without the dots ;))

i have to say, that i dont know much about libraries (always thought they should end with .dll or .lib ^^), but there is no file similar to this on my hd. i could offer some files in the gcc_lib dir like libwxmsw28d_core.a or libwxbase28d.a

any help?

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: QtWorkbench plugin
« Reply #117 on: May 04, 2007, 04:17:47 am »
soooooooooooo the wx variable is set to
base: ... wxWidgets-2.8.3
include: ... wxWidgets-2.8.3\include
lib: ... wxWidgets-2.8.3\lib\gcc_lib
(without the dots ;))

Code::Blocks expect lib dir to be wxWidgets-2.8.3\dll\gcc_dll during compilation of C::B, not the one you are using. If your system do not have that dir, recompile your wx as a Shared library (create a dll).
Be a part of the solution, not a part of the problem.

H0LL0

  • Guest
Re: QtWorkbench plugin
« Reply #118 on: May 04, 2007, 03:35:06 pm »
args, is qtworkbench actually running with wxwidgets 2.8.3?

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #119 on: May 05, 2007, 05:08:21 pm »
OK I updated the project to build using wx 2.8.3 and changed them to the current format. Worked without problems for me. It 's revision 18 in the svn.
« Last Edit: May 05, 2007, 05:13:08 pm by yop »
Life would be so much easier if we could just look at the source code.