Gentoo system upgrade after libpng compiler abnormal solution

Source: Internet
Author: User

After you upgrade your system, you are prompted to libpng upgrade, and you need to emerge @preserved-rebuild
Tragedy is that many packages are completely compiled, and these records under the partial package solution:

1, gnome-extra/ Libgda compilation failed

when linked, it prompts-lpng14 to not be found, apparently because libpng upgraded to 1.5. However, search all the makefile files inside the Libgda, no place to find a place to write a name link libpng14 this dynamic link library. The last reason to find this is because there are many xxx.la files in the/usr/lib64/directory, which are libtool used to manage dependencies, some of which have a dependency write name-lpng14 in some dynamic link libraries. The
finds the cause, and it's easy to solve. Start by grep command to find all the places written dead-lpng14, emerge these libraries again. However, there are some libraries that have been emerge and dependent or not corrected. Finally, by manually changing these documents, changed to-LPNG15. The

emerge is OK.

2, OpenCV compilation failed

OpenCV compilation failed, prompt for error: ' Max_mem_level ' is not declared into this scope, and so on. Google, because libpng1.5.x the original exposed PNG file structure is hidden, the header file contains only a pre-declaration and a heap of typedef. These should be the original in the definition of these PNG image structure, rely on the zlib, now can not indirectly rely on. The

workaround, of course, is to write a patch that forces modules/highgui/src/grfmt_png.cpp This file include zlib.h this header file, and the patch reads as follows:

The code is as follows Copy Code
-modules/highgui/src/grfmt_png.cpp.old 2011-09-19 19:36:49.759516862 +0800
+++ Modules/highgui/src/grfmt_png.cpp 2011-09-19 19:28:04.302185712 +0800
@@ -55,6 +55,7 @@
#include <libpng/png.h>
#else
#include <png.h>
+ #include <zlib.h>
#endif
#include "grfmt_png.hpp"



Write yourself a local portage, compile the OpenCV

In addition there are wxpython, this is really no way, but also because the libpng1.5.x hidden PNG image structure, resulting in the original direct access to the structure through the structure of the content of all errors, seemingly did not see the patch, and again.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.