|
|
Home » U++ TheIDE » U++ TheIDE: Packages » Am I misunderstanding how packages are supposed to work?
Am I misunderstanding how packages are supposed to work? [message #3310] |
Fri, 19 May 2006 11:07  |
Babs
Messages: 4 Registered: May 2006 Location: London, UK
|
Junior Member |
|
|
Hi there. I've just started looking at U++ with a mind to porting a pretty large app to it and I'm having some issues with how multiple packages work within a project. Hopefully someone can help me.
1- Should you have to #include the header file for a package, even if the package using it has it listed as 'Uses xxxx' in the package organiser? I can't get it to compile otherwise, but it seems to go against the whole point of packages. It also leads to the problem below:
2- I've got a package that has to use some external header files (It's a wrapper for some older software) which require extra include paths for compilation (-I or /I switches). Now, it seems sensible to me that these should only have to be specified for the package that actually needs the headers, or even just the whole project, but no. The only way to make it compile is to add the compiler options to every package that includes the package with the extra headers. This is very annoying as pretty much all of the packages in my app need to access it.
I assume I'm missing something simple here because if this is the way it's supposed to work it's actually more hassle than just including everything in one big package. At least then I'd only have to specifiy compilation options once for the whole project. I would be grateful if someone could shed some light on this for me.
On the plus side - I like pretty much everything else
Thanks in advance.
355e58fb36af625a92a9946dfe1f43b2
|
|
|
Re: Am I misunderstanding how packages are supposed to work? [message #3311 is a reply to message #3310] |
Fri, 19 May 2006 11:50   |
gprentice
Messages: 260 Registered: November 2005 Location: New Zealand
|
Experienced Member |
|
|
In TheIDE, click on the pink "help index" button, then have a read of "packages, assemblies and nests" (which I wrote) - especially the section near the end on "alternative include path mechanisms".
In there, I wrote
"the package-organizer allows you to enter additional switches to be passed to the compiler for all packages, for specific packages or for specific source files"
but I forget how to enter switches that apply to all packages ... - maybe Mirek can say if this is possible ...
Anyway, you can also use the "nest path setting" in the assembly setup - as described in "alternative include path mechanisms". I suggest you try and read all of "packages, assemblies and nests" though.
In answer to question 1 - what do you mean by the "header file for a package". Do you mean if you have a package called pkg1, then there is a header file called pkg1.h. You definitely have to do the #include pkg1.h yourself, even when your package uses pkg1. If U++ tried to auto #include certain header files I think it would seriously screw up some code. When a package uses another package, it just means that U++ will try to build and use the object files/libs of the used packages when it builds/links the main package.
Graeme
|
|
|
|
Re: Am I misunderstanding how packages are supposed to work? [message #3314 is a reply to message #3310] |
Fri, 19 May 2006 12:24   |
Babs
Messages: 4 Registered: May 2006 Location: London, UK
|
Junior Member |
|
|
I don't feel quite so stupid now as it's the same info that's on the website. While well-written and useful as an introduction it is somewhat lacking in specifics (this is not a dig - writing good documentation is both difficult and tedious and I'm glad you made the effort). It does seem I misunderstood how packages are supposed to work though, thanks for the pointers.
You do indeed write:
"the package-organizer allows you to enter additional switches to be passed to the compiler for all packages, for specific packages or for specific source files"
And then don't say how
Does anyone know?
355e58fb36af625a92a9946dfe1f43b2
[Updated on: Fri, 19 May 2006 12:27] Report message to a moderator
|
|
|
|
|
Re: Am I misunderstanding how packages are supposed to work? [message #3317 is a reply to message #3316] |
Fri, 19 May 2006 13:50   |
gprentice
Messages: 260 Registered: November 2005 Location: New Zealand
|
Experienced Member |
|
|
Babs wrote on Fri, 19 May 2006 23:14 | Thanks for your speedy reply, but unless I've missed something that section is purely about build configurations. This is fine, and the way I've configured my packages at the moment (by adding the compiler switches to each package tied to WIN32), but it makes no mention of how to add an option (be it compiler switches or additional libs) that will automatically be applied to all packages in the project without having to add it manually to each one.
If such a thing exists I would like to know how to do it but at the end of the day it more an annoyance/laziness issue than anything else. And I can't bitch too much because since it's open source I can always add it myself
|
Um, well, it says this in the help file ...
<quote>
"Compiler options. These are text strings that will be supplied on the command line to the compiler. These will be added to the command line after (at the end of) the compiler options generated by TheIDE. These options affect all source files being compiled, not just those from the main package, however you can use build flags and the "dotted" mechanism (see Package-build-configurations above) to restrict which packages the options are applied to."
<end quote>
In the package organizer, to add compiler options, right click and select "new compiler options", then enter e.g. GCC in the "When" column and -Iwhatever in the options column, or e.g. MSC8 in the when column and /Iwhatever in the options column.
According to what I wrote in the help file, the -I or /I switches as above will be used for all source files compiled in the project across all packages. I believe I tested this at the time I wrote it but I'm not 100% sure I tested it "transitively".
Am I making any sense ??
Graeme
|
|
|
|
Goto Forum:
Current Time: Fri May 09 08:49:54 CEST 2025
Total time taken to generate the page: 0.04007 seconds
|
|
|