I try to use libpng library, and I encounter problem with it.
I am using CLion now, and try to include this libpng library in my project.
The problem is rather with configuration of this library to use it in my project than using this library. I think that I can make copy all *.c, *.h files from libpng into my own project in CLion, make from it static library liblibpng.a and just link against it. I even compiled liblibpng.a but when I try to use it, i.e. simple including ${path}/libpng-x.x.x/png.h there are errors and warnings in the png.h file like lack of png_uint_32
definition. Ok I can typedefine this somehow like unsigned int
.
I am trying to read README.txt, and other manuals/documantations, INSTALL.txt? But there is a lot os possibilities, and I just want to include png functionalities in my project. Why there is need to install this library? I want that my app after creation in the future will be easly portable to other computers without 3rd party libraries installation needed at all.
My question is hot to easily start using this libpng, and porbably also zlib libraries in my own project in CMake, I prefer static library linking, I don't want any specific installation, etc.
I think I have a problem with this declaration as this instead of defining png_uint_32
just throw error! It is from pngconf.h
#if UINT_MAX > 4294967294
typedef unsigned int png_uint_32;
#elif ULONG_MAX > 4294967294
typedef unsigned long int png_uint_32;
#else
# error "libpng requires an unsigned 32-bit (or more) type"
#endif