Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Include option for specific package
Include option for specific package [message #21906] Wed, 10 June 2009 10:39 Go to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello All,

I didn't find if exist a method for set include option for specific package.

I thing that it is a possibility to add "compiler option" in package organizer, but if exists more explicit method which i do not know, please tell me.

I want continue to develop wrapper xlslib package started by Koldo.

This will be great because in include option will be not need to add the full path of include directory, but on compiling process, IDE will add full path. Another opportunity is increasing compilation process: specific include folders by package will set in case the developer will use this packages with specific include option.

In base of xlslib package we will add in package organizer for link option only:
/lib/common
/lib/xlslib
/lib/oledoc
/lib/data

This realization can be uses in sdl package too, or in other external plugins.

I hope I was clear

Thank you in advance.
Re: Include option for specific package [message #21913 is a reply to message #21906] Wed, 10 June 2009 16:00 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello all

Yes I agree. It would be interesting to have in, for example, "Package Organizer", a way to include something like "New Include" in here

index.php?t=getfile&id=1781&private=0

Best regards
Koldo
  • Attachment: Dib.JPG
    (Size: 46.34KB, Downloaded 957 times)


Best regards
Iñaki
Re: Include option for specific package [message #21914 is a reply to message #21913] Wed, 10 June 2009 16:28 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
It's possible to put new include paths at "New compiler option", so I don't see why have another "Include" option when you can control the compiler so easy.
Re: Include option for specific package [message #21915 is a reply to message #21914] Wed, 10 June 2009 17:10 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

andrei_natanael wrote on Wed, 10 June 2009 17:28

It's possible to put new include paths at "New compiler option", so I don't see why have another "Include" option when you can control the compiler so easy.


In "New compiler option" is possibility to add not full path directory?
Re: Include option for specific package [message #21916 is a reply to message #21915] Wed, 10 June 2009 17:15 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
AFAIK, yes:

-I/usr/include


These options are transparently used on the compile command line.

Matthias
Re: Include option for specific package [message #21917 is a reply to message #21916] Wed, 10 June 2009 17:33 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

masu wrote on Wed, 10 June 2009 18:15

AFAIK, yes:

-I/usr/include


These options are transparently used on the compile command line.

Matthias


I tried, it didn't compiled, because the default directory is not package directory.

I can try this to add and propose to Mirek. this is a minor change!
Re: Include option for specific package [message #21918 is a reply to message #21917] Wed, 10 June 2009 17:42 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
It works for me, I just moved a header file in one of my projects to "C:\temp" and added Compiler option -Ic:/temp to the main package.
Then I changed references to the moved header to <xxx.h> (I used "xxx.h" before) and it is found and the project compiles.
You may also have to change your references to header file then.

Matthias
Re: Include option for specific package [message #21919 is a reply to message #21918] Wed, 10 June 2009 17:55 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

masu wrote on Wed, 10 June 2009 18:42

It works for me, I just moved a header file in one of my projects to "C:\temp" and added Compiler option -Ic:/temp to the main package.
Then I changed references to the moved header to <xxx.h> (I used "xxx.h" before) and it is found and the project compiles.
You may also have to change your references to header file then.

Matthias


Ok, I thing that I will be understanding in real example:

I have a package located in:
D:\ILupascu\sourcecode\cpp\upp\MyApps\xlslib\

I need add include libs for directories:
D:\ILupascu\sourcecode\cpp\upp\MyApps\xlslib\lib\src\oledoc\
D:\ILupascu\sourcecode\cpp\upp\MyApps\xlslib\lib\src\xlslib\
D:\ILupascu\sourcecode\cpp\upp\MyApps\xlslib\lib\src\common\
D:\ILupascu\sourcecode\cpp\upp\MyApps\xlslib\lib\src\data\

As you see this is located in sub folder of package. this package I can relocated and include libraries will located too.

I propose to add in Package organizer an option "Include option" that in option will be only:

/lib/src/oledoc
/lib/src/xlslib
/lib/src/common
/lib/src/data

In compiling the package which have this include options or use an package which have this compiling option, U++ will set to compiler include option the full path of this 4 directories.

If I do not use this option U++ will not set this include options.

Like this situation I can add as example SDL packages.

Re: Include option for specific package [message #21920 is a reply to message #21919] Wed, 10 June 2009 18:16 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Why don't you do it like this?

You only need to specify a long path once for each include dir in your xls package.

Matthias
  • Attachment: MyApps.zip
    (Size: 1.62KB, Downloaded 270 times)
Re: Include option for specific package [message #21921 is a reply to message #21920] Wed, 10 June 2009 19:00 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Why?
Because the package I can relocated and include libraries will automatic located too (I mean the full path)
masu wrote on Wed, 10 June 2009 19:16

Why don't you do it like this?

You only need to specify a long path once for each include dir in your xls package.

Matthias

[Updated on: Wed, 10 June 2009 19:01]

Report message to a moderator

Re: Include option for specific package [message #21922 is a reply to message #21921] Wed, 10 June 2009 19:58 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
Why do you need the full path?
The paths you want to include are all relative to xls (or whatever your package name is), right?

You should be able to move the xls package into another assembly and add this package to your project, the include paths are automatically included within xls.h.

Matthias
Re: Include option for specific package [message #21923 is a reply to message #21922] Wed, 10 June 2009 20:35 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
I'm thinking, for instance, MySQL or PostgreSQL. They do not contain the PostgreSQL includes nor libs. When I compiled it the first time, I had to go to Setup>Build methods and add PostgreSQL to my include path, the full path. I didn't know about the specific compiler options that I learned here.

However, I think a nice Include/Lib path setup like found in Setup>Build per package would be a nice addition. It's something many people have to do.
Re: Include option for specific package [message #21925 is a reply to message #21923] Wed, 10 June 2009 23:58 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello all

I have included the directories in the Package Organizer using the -I option. It works for GCC/MinGW and MSC.

So for both compilers the program works well. For now perhaps it is enough but I think it is nicer to include the include directories as an explicit Package option...

... But I have a problem with MSC:
Both XlsLibs and \Microsoft SDKs\Windows\v6.1\Include have a file named rectypes.h Sad

To avoid errors, XlsLib directories have to be before SDK directories. Unfortunately it seems Upp
- First reads Build Methods
- Second reads Package Organizer

So in this case:
- Or I have to do dirty things: renaming rectypes.h in SDKs Rolling Eyes
- Or I have to put XlsLib include directories in Build Methods, and before \Microsoft SDKs\Windows\v6.1\Include

Best regards
Koldo


Best regards
Iñaki
Re: Include option for specific package [message #21928 is a reply to message #21925] Thu, 11 June 2009 07:45 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

koldo wrote on Thu, 11 June 2009 00:58

Hello all

I have included the directories in the Package Organizer using the -I option. It works for GCC/MinGW and MSC.

So for both compilers the program works well. For now perhaps it is enough but I think it is nicer to include the include directories as an explicit Package option...

... But I have a problem with MSC:
Both XlsLibs and \Microsoft SDKs\Windows\v6.1\Include have a file named rectypes.h Sad

To avoid errors, XlsLib directories have to be before SDK directories. Unfortunately it seems Upp
- First reads Build Methods
- Second reads Package Organizer

So in this case:
- Or I have to do dirty things: renaming rectypes.h in SDKs Rolling Eyes
- Or I have to put XlsLib include directories in Build Methods, and before \Microsoft SDKs\Windows\v6.1\Include

Best regards
Koldo


Very interesting detail.

To avoid this situation should be add first package include and after then standard builds.

This situation is another motivation to add this include option.

Ion Lupascu (tojocky)
Re: Include option for specific package [message #21930 is a reply to message #21923] Thu, 11 June 2009 11:48 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
jeremy_c wrote on Wed, 10 June 2009 20:35

I'm thinking, for instance, MySQL or PostgreSQL. They do not contain the PostgreSQL includes nor libs. When I compiled it the first time, I had to go to Setup>Build methods and add PostgreSQL to my include path, the full path. I didn't know about the specific compiler options that I learned here.

However, I think a nice Include/Lib path setup like found in Setup>Build per package would be a nice addition. It's something many people have to do.

For MySQL and PostgreSQL you cannot include these definitions within the wrapper package, because they are installed Upp-external, i.e. they could be located elsewhere on different machines. That is why you must set the paths manually.

Matthias
Re: Include option for specific package [message #21931 is a reply to message #21930] Thu, 11 June 2009 12:18 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Yes, I understand, but I could configure the include path on my local box for the PostgreSQL package, if the package based include dialog existed, is what I was thinking?

Jeremy
Re: Include option for specific package [message #21933 is a reply to message #21931] Thu, 11 June 2009 19:13 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Thu, 11 June 2009 06:18

Yes, I understand, but I could configure the include path on my local box for the PostgreSQL package, if the package based include dialog existed, is what I was thinking?

Jeremy



Packages are designed to be uncoupled from actual host (either platform or even development computer), that is why adding any paths to package definition is definitely not a good idea.

Mirek
Re: Include option for specific package [message #21941 is a reply to message #21933] Thu, 11 June 2009 21:02 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

luzr wrote on Thu, 11 June 2009 20:13


Packages are designed to be uncoupled from actual host (either platform or even development computer), that is why adding any paths to package definition is definitely not a good idea.

Mirek



Hello Mirek!
But if is a wrapper package for a speciffic lib (example xlslib) and this speciffic lib is ported in wrapper package (sub directory) I thing that it is sense. This lib can be cross-os too and can be uncoupled from actual host. It Is sense because it is not need to modify include prepocesors (correct from #include <header.h> to #include "header.h").
Another method is to add an wizard to import package (files in project) with option correct include tags.
Best idea I thing that need add both methods!
Re: Include option for specific package [message #21942 is a reply to message #21933] Thu, 11 June 2009 21:02 Go to previous messageGo to next message
jeremy_c is currently offline  jeremy_c
Messages: 175
Registered: August 2007
Location: Ohio, USA
Experienced Member
Right, but I should add the include directory to postgresql in my global setup, so that it affects all projects? I figured that per install, per package I could set where my package of postgresql should be able to find it's libs/includes.

Jeremy
Re: Include option for specific package [message #21944 is a reply to message #21942] Thu, 11 June 2009 22:48 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
jeremy_c wrote on Thu, 11 June 2009 15:02

Right, but I should add the include directory to postgresql in my global setup, so that it affects all projects?



Yes. It is least troublesome.

Mirek
Previous Topic: Abstract Draw
Next Topic: CeGCC
Goto Forum:
  


Current Time: Fri Mar 29 12:50:45 CET 2024

Total time taken to generate the page: 0.01805 seconds