What should I do if libpng fails to compile after Gentoo upgrade?

  
                

Before Gentoo upgrade, users can still use libpng normally. After upgrading Gentoo system, many users have libpng compiled abnormally. A large number of packages can't be compiled. The following small series will introduce you to solve libpng. Compile an abnormal method.

After you have upgraded the system, you are prompted to upgrade libpng, need to re-emerge @ preserved-rebuild, but many packages fully compiled, however, and the following solutions.

1, gnome-extra/libgda failed to compile

At the time of the link, the prompt -lpng14 could not be found, obviously because libpng was upgraded to 1.5. However, after searching all the Makefiles in libgda, there is no place to find a place to link to the dynamic link library of libpng14. The last reason to find it is because there are many xxx.la files in the /usr/lib64/directory, which is used by libtool to manage dependencies. Some of the dynamic link libraries have a dependency named -lpng14.

After finding the reason, first find all the places where the write-lpng14 is written by the grep command, and re-emerge these libraries. However, some libraries were found to be re-emerged, and the dependencies were still not corrected. Finally, by manually changing these files, change to -lpng15.

Re-emerge is OK.

2, opencv compiler failed

opencv compiler failed, the prompt is error: & lsquo; MAX_MEM_LEVEL & rsquo; was not declared in this scope and other errors. Because libpng1.5.x hides the original png file structure, there is only one pre-declaration and a bunch of typedefs in the header file. These should be the zlib that was originally relied upon when defining these png image structures, and now you can't rely on them indirectly.

The solution is to write a patch that forces the modules/highgui/src/grfmt_png.cpp file to include the zlib.h header file. The patch content is as follows:

— 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 a local portage, compile Ok opencv

There is also wxPython, this is really no way, because libpng1.5.x hides the png image structure, resulting in the original access to the structure directly through the structure pointer error, no patch.

The above is the solution to the problem that libpng can't be compiled after Gentoo upgrade. This article introduces the solutions of the two situations, which can be solved according to the user's specific situation.

Copyright © Windows knowledge All Rights Reserved