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 » Use zlib inside another library
Use zlib inside another library [message #47638] Mon, 20 February 2017 19:41 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi,

I've got a peculiar problem... I'm importing 'libarchive', which I need to decompress various archive formats.
On linux no problems, as usual, we've zlib there.
On windows no zlib, and the libarchive library has 2 options :

1) define HAVE_ZLIB_H, and it will try to include <zlib.h> (which is missing on windows)
2) not define HAVE_ZLIB_H and it will drop support for this kind of compression.

As we've zlib into z package, I wonder if there's a way to use it without having to patch libarchive sources.
I mean... is there a way, from package organizer, to make #include <zlib.h> to use the plugin/z/lib/zlib.h one ?
Possibily without having to hard-code the full path into package organizer, as my libarchive is on a nest OUTSIDE upp folders.
I tried with compiler option -I, but it needs a complete path. Something like providing a $PACKAGE_PATH into package organizer could do the trick, in this case entering something like
-I$PACKAGE_PATH("plugin/z")/lib
Re: Use zlib inside another library [message #47639 is a reply to message #47638] Mon, 20 February 2017 19:45 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
anyways, I've seen that putting 'lib' as internal includes for plugin/z package do the trick.
Is it possible to have it as a default on windows ? I think that zlib could be quite useful for other packages too...
Re: Use zlib inside another library [message #47679 is a reply to message #47639] Sat, 04 March 2017 17:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sure, but could you send me exact .upp file (or .diff or somethin) so that I am sure I am fixing the right thing?
Re: Use zlib inside another library [message #47702 is a reply to message #47679] Tue, 07 March 2017 18:36 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Hi Mirek, shure!

Here you have my Archive package (don't look at it too much, is just the bare minimum for what I need, it could be extended to use the whole libarchive library).

The problemi is the usage of ZLIB and BZLIB, already present in UPP; the only way I found to do it is to add an internal include to both packages.

It would be better to find a way to "import" the zlib and bzip code from the Archive package and not the way around as I'm doing now.


Thank you


Massimo
  • Attachment: Archive.zip
    (Size: 915.28KB, Downloaded 191 times)
Re: Use zlib inside another library [message #47703 is a reply to message #47702] Tue, 07 March 2017 23:27 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Checking archive... there is now a new way how to integrate 3rd party libs like this. Check bazaar/plugin/gdal.

http://www.ultimatepp.org/app$ide$importext$en-us.html

As to the original problem, I think one way would be to add "zip.h" file to Archive folder which will contain "#include <plugin/z/lib/zlib.h>" and would be picked by this Archive's .ext file.

Mirek
Previous Topic: ASSERT when using ValueMap
Next Topic: What is the highest version of U++ that does not require C++11 ?
Goto Forum:
  


Current Time: Thu Mar 28 19:02:28 CET 2024

Total time taken to generate the page: 0.02098 seconds