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 » U++ Library support » U++ Library : Other (not classified elsewhere) » libpng on linux
libpng on linux [message #48209] Mon, 05 June 2017 21:53 Go to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

if I have understood the libpng coming with U++ is the version 1.2.57 (shared library 12.0).

Some users of my program are reporting that it no longer works. One told me that the new libpng currently available is the shared library 16.0 and the version 12.0 is no longer available in the main repository (for example in Ubuntu).

The question is: can I solve my problem putting the source code of the new libpng16 within the folder
/upp/uppsrc/plugin/png/lib and compile it?
Are there problems with the current plugin for this library?

Thank you,
Luigi
Re: libpng on linux [message #48211 is a reply to message #48209] Tue, 06 June 2017 06:45 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Luigi,

forlano wrote on Mon, 05 June 2017 21:53
The question is: can I solve my problem putting the source code of the new libpng16 within the folder
/upp/uppsrc/plugin/png/lib and compile it?
Are there problems with the current plugin for this library?

Short answer: No, upgrading the plugin won't help.

Long answer: plugin/png is only used on windows. On other platforms it is linked against the libpng installed in the system. So if you want to support clients with newer libpng, you need to upgrade the system on which you build your binaries.

Alternatively, you can use flag STATIC_PNG. This will force the plugin/png to use the contained sources and link them statically. So it will use the older version (1.2.57), but there will be no runtime dependence on libpng and the binary should run anywhere, regardless of the version of libpng the client has installed.

Best regards,
Honza
Re: libpng on linux [message #48225 is a reply to message #48211] Tue, 06 June 2017 18:08 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
dolik.rce wrote on Tue, 06 June 2017 06:45


Alternatively, you can use flag STATIC_PNG. This will force the plugin/png to use the contained sources and link them statically. So it will use the older version (1.2.57), but there will be no runtime dependence on libpng and the binary should run anywhere, regardless of the version of libpng the client has installed.


Hi Honza,

thanks for the answer.
The flag option is fine and perhaps the best.
I just wonder if it must be set in the header field of theide (where I have already GUI NOGTK flags) or via the package organize and where exactly.

Thanks again,
Luigi
Re: libpng on linux [message #48226 is a reply to message #48225] Tue, 06 June 2017 18:41 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

forlano wrote on Tue, 06 June 2017 18:08
The flag option is fine and perhaps the best.
I just wonder if it must be set in the header field of theide (where I have already GUI NOGTK flags) or via the package organize and where exactly.

Yes, you can just put it in the "mainconfig" (not sure what the official name is, this is just how it is called in .upp files Smile ), together with GUI and NOGTK flags.

Honza
Re: libpng on linux [message #48231 is a reply to message #48226] Wed, 07 June 2017 18:10 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
dolik.rce wrote on Tue, 06 June 2017 18:41

Yes, you can just put it in the "mainconfig" (not sure what the official name is, this is just how it is called in .upp files Smile ), together with GUI and NOGTK flags.

Honza


Hi Honza,

The esperiment failed. STATIC_PNG missed to link statically libpng12.

I tried to install libpng16 and compile theide via makefile. Unfortunately the makefile complained for the missing libpng12.

Is there something ti try?

Luigi
Re: libpng on linux [message #48292 is a reply to message #48231] Thu, 15 June 2017 21:41 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Luigi,

Sorry for late reply, I didn't have time to test it until today.

forlano wrote on Wed, 07 June 2017 18:10
The esperiment failed. STATIC_PNG missed to link statically libpng12.

How did you test this? I just tried to compile simple app with STATIC_PNG and it seems to work. There is no -lpng in the linker command and readelf -d my_test_app | grep NEEDED doesn't show libpng at all. Also, objdump -x my_test_app shows the png symbols in the executable. The only confusing thing is the output of ldd my_test_app, which still lists libpng, but I assume it is actually pulled in indirectly by another dependency. Have you actually tried to run the executable on some newer system?

forlano wrote on Wed, 07 June 2017 18:10
I tried to install libpng16 and compile theide via makefile. Unfortunately the makefile complained for the missing libpng12.
Not sure about that... If I remember correctly, the makefile should not mention specific version of the library, just "png". I use archlinux where libpng16 is the only version available and I actually never had a problem with it.

I'm afraid I don't have any more ideas how to solve your problem for now (if the problem still holds).

Best regards,
Honza

[Updated on: Thu, 15 June 2017 21:41]

Report message to a moderator

Re: libpng on linux [message #48293 is a reply to message #48292] Thu, 15 June 2017 22:10 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1182
Registered: March 2006
Location: Italy
Senior Contributor
dolik.rce wrote on Thu, 15 June 2017 21:41
Hi Luigi,

Sorry for late reply, I didn't have time to test it until today.


Hi Honza,

no prob and thanks again for your precious support.
At moment one of my user gave me a script wrapper that load the provided libpng12 in case it is absent on the system.

I tested it simply adding STATIC_PNG flag in the main configuration (together GUI and NO_GTK flags). Perhaps something else should be done. The compiled program didn't work on a system without libpng12.

Perhaps you can post the whole test package you have used so that I can see all relevant flags and setting you have set. I think is very important to be able to add statically a lib in case something occur in future with some other library.

Luigi
Re: libpng on linux [message #48925 is a reply to message #48209] Fri, 03 November 2017 12:34 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
Same problem here... app built on Ubuntu16.04 LTS doesn't run on newest 17 version.
I did a text search for STATIC_PNG in whole UPP tree, no traces of it, so the reported solution must be wrong.
I tried to remove png lib from plugins/png package and add it as static lib, but I got just errors.

Is there a way to force static linking of PNG library ?
I remember I did it with ssl library as above, and it worked. With PNG no way up to now.

Ciao

Massimo
Re: libpng on linux [message #48926 is a reply to message #48925] Fri, 03 November 2017 18:41 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Fri, 03 November 2017 12:34
Same problem here... app built on Ubuntu16.04 LTS doesn't run on newest 17 version.
I did a text search for STATIC_PNG in whole UPP tree, no traces of it, so the reported solution must be wrong.
I tried to remove png lib from plugins/png package and add it as static lib, but I got just errors.

Is there a way to force static linking of PNG library ?
I remember I did it with ssl library as above, and it worked. With PNG no way up to now.

Ciao

Massimo


Well, but that is general nature of linux, is it not? You cannot expect that binary built with different distro/version will work out of box.

(That said, personally I would probably prefer static linking of png too...)

Mirek
Re: libpng on linux [message #48927 is a reply to message #48926] Sat, 04 November 2017 13:29 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

Did anyone try Snappy or any other universal Linux packages? I believe this will resolve the dependency problem and allow to run your application on multiple distribution. Probably the cost of that solution is the final application size.

Snappy - https://www.ubuntu.com/desktop/snappy

Sincerely,
Klugier


U++ - one framework to rule them all.
Re: libpng on linux [message #48928 is a reply to message #48926] Sat, 04 November 2017 15:28 Go to previous messageGo to next message
mdelfede is currently offline  mdelfede
Messages: 1307
Registered: September 2007
Ultimate Contributor
mirek wrote on Fri, 03 November 2017 18:41

Well, but that is general nature of linux, is it not? You cannot expect that binary built with different distro/version will work out of box.

(That said, personally I would probably prefer static linking of png too...)

Mirek


Yep, but the weird stuff is that libpng is the only library that brings problems, up to now.
Do you think it's possible to have it statically linked in some way ? Or... what about replacing with the source that is inside the png plugin, which is used for windows ?
Re: libpng on linux [message #48931 is a reply to message #48928] Sat, 04 November 2017 20:56 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
mdelfede wrote on Sat, 04 November 2017 15:28
mirek wrote on Fri, 03 November 2017 18:41

Well, but that is general nature of linux, is it not? You cannot expect that binary built with different distro/version will work out of box.

(That said, personally I would probably prefer static linking of png too...)

Mirek


Yep, but the weird stuff is that libpng is the only library that brings problems, up to now.


That is just accidental.

Mirek
Previous Topic: reference/OpenGL crashes
Next Topic: Filtering streams for bz2
Goto Forum:
  


Current Time: Thu Mar 28 13:18:51 CET 2024

Total time taken to generate the page: 0.01141 seconds