Author Topic: QtWorkbench plugin  (Read 256051 times)

pibeac

  • Guest
Re: QtWorkbench plugin
« Reply #150 on: July 02, 2007, 07:42:32 pm »
I've downloaded QtWorkbench0.5.0Alpha ( which i found as the latest version ).

I created a Dynamic Link Library project with codeBlock and i used your QTWorkbench to create the .pro and makeFile files. It did work fine, but when i compiled ( using the makefile ) it created a lib.a and an executable file and no lib.dll... So i checked in the .pro file and found that the following:
...
CONFIG += qt dll debug
...
TEMPLATE += lib

i changed the line "TEMPLATE += lib" for "TEMPLATE = lib" and rerun qmake -Makefile to regenerate the makefile, then i recompiled my project and then the output was a lib.a and lib.dll and there was no executable file anymore!

I believe that the TEMPLATE variable holds a "app" and the with the += we add the lib.... so with the "=" we overwrite completely the TEMPLATE variable and gives the correct output.

I am not sure if it's a bug with your plugin or just me who doesn't know how to use it correctly...
i am a bit new to qt-Code::blocks-qmake.

By the, that plugin is really nice!!!

Thanks!

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #151 on: July 03, 2007, 06:27:50 pm »
It 's a bug, I rewrote the .pro parser and generator for version 0.5 and it still isn't what I 'd like it to be but it's much better than what it used to be ;)
If you have any suggestions and/or more bugs or inconveniences while working with the plugin you are welcome to add them to the issue tracker in http://code.google.com/p/qtworkbench/issues/list
Life would be so much easier if we could just look at the source code.

pibeac

  • Guest
Re: QtWorkbench plugin
« Reply #152 on: July 03, 2007, 09:53:43 pm »
Thanks for the reply, i plan on using your plugIn a lot, so i will contribute to the bug list =)

H0LL0

  • Guest
Re: QtWorkbench plugin
« Reply #153 on: July 05, 2007, 05:44:12 pm »
hi, i just wanted to say, that everything works fine, and your tutorials are working very good.

its just, that issue no. 7 is pissing me off :p
is there anything i can do? i mean, except copy pasting the line to console and insert the "" ?

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #154 on: July 06, 2007, 12:37:59 pm »
Hi,
I just returned from yet another business trip and I 'll download texmaker to check issue #7.
Life would be so much easier if we could just look at the source code.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #155 on: July 14, 2007, 12:41:19 pm »
hi, i just wanted to say, that everything works fine, and your tutorials are working very good.

its just, that issue no. 7 is pissing me off :p
is there anything i can do? i mean, except copy pasting the line to console and insert the "" ?

H0LL0 you might be interested in http://code.google.com/p/qtworkbench/wiki/ImportingProjects ;)
Life would be so much easier if we could just look at the source code.

Offline AnTeevY

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: QtWorkbench plugin
« Reply #156 on: July 17, 2007, 03:15:43 pm »
Hello, I've got some problems with the plugin... (I've read alle those tuts: http://code.google.com/p/qtworkbench/wiki/PluginUsage)

1. What's the difference between choosing to create a release or a debug target when creating the project, I mean, does it matter, because later you can choose between both in the Qt Project options again?
2. In the Qt Project options, it's irrelevant whether I select "Release" or "Debug" or both, when I build, it just does the one I' chosen when creating the project. Debug mode also only works if I've created a debug target, but the docs say "Also note that although we created a "Release" target when we created the project we can set our target to be a "Release" or "Debug" target from the Qt project options dialog."?
3. In the Create Targets Dialog (project creation), if I type in another name than "Release" (in the Release field) or "Debug" (in the Debug field), I can't compile because there "is no rule to make target ***" (*** = the name of the target). Why is this?
4. Something about makefiles: why does it always create both release and debug ones?

Thanks ;)

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #157 on: July 17, 2007, 04:15:53 pm »
1. What's the difference between choosing to create a release or a debug target when creating the project, I mean, does it matter, because later you can choose between both in the Qt Project options again?
You get different compiler/linker flags generated from Code::Blocks and propogated to your Makefiles. For instance in "Release" targets you get -O2 in compiler options and -s in linker (optimize and strip respectively).
2. In the Qt Project options, it's irrelevant whether I select "Release" or "Debug" or both, when I build, it just does the one I' chosen when creating the project. Debug mode also only works if I've created a debug target, but the docs say "Also note that although we created a "Release" target when we created the project we can set our target to be a "Release" or "Debug" target from the Qt project options dialog."?
This should not happen.
3. In the Create Targets Dialog (project creation), if I type in another name than "Release" (in the Release field) or "Debug" (in the Debug field), I can't compile because there "is no rule to make target ***" (*** = the name of the target). Why is this?
This should not happen.
4. Something about makefiles: why does it always create both release and debug ones?
This is the default behavior of qmake in windows. You get both files and depending on the entry in Qt project options the upper level Makefile decides which one to use. Anyway this is transparent and handled by qmake so there is nothing to worry about there.


I have a feeling that for 2. and 3. you have a setting wrong. If it is possible to attach a sample project that presents the problems above, it would help a lot. Anyway I am preparing 0.5.1 that fixes a few things that were reported (actually one that I found pretty major: the default operator in .pro files can be dynamic depending on the identifier, e.g. TEMPLATE now has "=" while others can have "+="). If there is a bug that causes 2. and / or 3. I would like to fix it before releasing it.
Since I am sure that many users will just mess up setting up a new project (because it is actually quite hard to do, I even mess it up sometimes) the next step I guess will be providing a QtWorkbench wizard for creating new projects and targets that will handle the setting up and you 'll just have to concentrate on getting your work done not configuring a stupid plugin :-)
Life would be so much easier if we could just look at the source code.

Offline AnTeevY

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: QtWorkbench plugin
« Reply #158 on: July 17, 2007, 04:30:26 pm »
Thanks for the quick reply. I'll try to upload a sample project this evening (in Germany GMT+1), which means in ~6 hours.
Ah, and another weird thing I forgot to mention: the first makefile created by the qmake shortcut in the menu is "makefile.targetname" (+ makefile.targetname.release and makefile.targetname.debug), but if
a) I try to compile and they are not found by the compiler (because normally it searches for "makefile" and not for "makefile.targetname" [this isn't mentioned in the setting-up-a-project-tutorial?]) or
b) I delete the makefiles
and I click on the shortcut again, qmake creates new ones, which look like makefile.targetname.targetname.release for example, and if I redo a) or b) it creates makefile.targetname.targetname.targetname.release and so on.
I hope this helps you :)

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #159 on: July 17, 2007, 05:09:14 pm »
...(because normally it searches for "makefile" and not for "makefile.targetname" [this isn't mentioned in the setting-up-a-project-tutorial?])...
This is indeed documented in http://code.google.com/p/qtworkbench/wiki/QtWorkbenchProjects , there (check the screenshot) we change the Makefile that make tries to find to <whatever the Makefile name is>.<target>
This is done in order to support the (honestly) only deviation I take from the way qmake expects to follow for .pro generation (for multiple targets I should have a SUBDIR entry etc. but then it wouldn't play nice with C::B, I 've down that path ;-) )
So actually what happens is simple, for two targets:

* target1.pro and target2.pro are genrated by QtWorkbench in the project top level folder
* QtWorkbench calls qmake that creates Makefile.target1 and Makefile.target2 in the project top level folder
* C::B calls make using Makefile.target1 and Makefile.target2 from the project top level folder and C::B build system is happy :-) (so we can use the debugger, or launch the executable or whatever)

I 'll check the bug you mention (it's a funny one you must admit :-) )


Life would be so much easier if we could just look at the source code.

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #160 on: July 17, 2007, 10:11:45 pm »
I 'm sorry but I can't reproduce these problems. I started off with a new project and my all time favorite victim (the Qt examples) and I selected a "Debug" project then switched to Release from Qt Project options and got a Release build. Then vice versa and it worked again.

Then I added another target and it also worked as expected.

Then I started removing Makefiles (all of them, some of them whatever I could think of) and only the appropriate Makefiles were generated.

I did find a problem in the naming of the output caused because in the .pro I use a += operator for the output but this is fixed in the upcoming release.

I used rev 4263 build of Code::Blocks and QtWorkbench 0.5.0
Life would be so much easier if we could just look at the source code.

Offline AnTeevY

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: QtWorkbench plugin
« Reply #161 on: July 17, 2007, 10:49:30 pm »
Okay, sorry.
I've just tried a lot an finally found out my fault... I changed the "Make" Commands for the project itself but of course they got overwritten by those of the build target, which I didn't change. That's why the compiler did not find the makefile, so I changed it in the dialog where I selected "This is a custom Makefile". I think this caused all those strange bugs. Sorry again.

But one more question: is it possible to build both release and debug at once? Ok, in the Qt Project Options you can choose them both, but of course this does not work, because in both the makefile.targetname.release and makefile.targetname.debug it says:
TARGET         = targetname.exe
DESTDIR_TARGET = bin\targetname\targetname.exe

If I create a empty project with Release and Debug targets, then run "qmake -project" and "qmake projectname", in C::B I can choose between both targets and when compiling the exe's are created in Debug\ resp. Release\ folders. Is this possible with the plugin? I think, you need 2 build targets, but then the plugin creates two project files, and then there are 6 makefiles... is there an easier way?

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #162 on: July 17, 2007, 11:29:39 pm »
Don't apologize, I already mentioned that it's quite difficult to remember to make all those little tweakings (I wonder if such a word exists) here and there to prepare your project and targets. When I release 0.5.1 (it's necessary to fix this bug with the operators in the .pro files) I will prepare wizards for project and target generation so it's (hopefully) trivial to prepare them.
As for your question no there isn't an easier way or at least I can't think of something, except if C::B itself has some kind of magic under the hood (which frankly happens quite often).
Life would be so much easier if we could just look at the source code.

Mayler

  • Guest
Re: QtWorkbench plugin
« Reply #163 on: July 21, 2007, 06:05:53 pm »
I cannot compile even the TexMaker... I made exactly what the wiki is saying... What's Wrong?

My error in my project ( equal the texmaker )

g++: Raiox.Debug: No such file or directory
mingw32-make.exe[1]: Leaving directory `C:/Documents and Settings/Mayler/Desktop/rx'
mingw32-make.exe[1]: *** [bin\RaioX.exe] Error 1
mingw32-make.exe: *** [debug] Error 2
Process terminated with status 2 (1 minutes, 4 seconds)

Using gcc 3.4.5, Qt 4.3, CB 4285 and QtWorkbench 0.5.0

Offline yop

  • Regular
  • ***
  • Posts: 387
Re: QtWorkbench plugin
« Reply #164 on: July 21, 2007, 07:13:25 pm »
What is "Raiox" ? Have you setup a target named like that?
Life would be so much easier if we could just look at the source code.