I am totally new to lib png and png++ and have recently made my first project with these on linux. But have no idea how to use png++ on windows. I have my libpng configured on windows and am wondering how to move towards making png++ available and running my code which I have already built on linux and now i want to run it on windows with visual studio 2008.
I would be very grateful if someone can give some pointers. I have a deadline.
png++ is a header only, library, which means you don't need to build anything (except libpng, of course). Read "INSTALL" file which comes with the library.
Yes, thats what i wanted to ask. The INSTALL file has the following instructions for linux and i have no idea how to translate it for VC++.
Follow these instructions in order to install png++:
- Unpack source package:
$ tar -zxf png++-0.2.x.tar.gz -C ~/src
- Go to your brand new png++ sources directory:
$ cd ~/src/png++-0.2.x
- Issue make to test how it's doing:
$ make
This will compile examples in the example/ directory.
As always, CFLAGS and LDFLAGS could be used to adjust compilation. In
addition, you might want to specify custom libpng-config. Use
LIBPNG_CONFIG variable for that purpose, like this:
$ make LIBPNG_CONFIG=~/bin/libpng-config
If everything goes well, try:
$ make test
(or "make check" which is the same as above). This will run the test
suite. If tests do not produce error messages then probably all is
OK.
- Now you can create documentation (optional). Use
$ make docs
to run doxygen in the sources directory.
- Now it is time to become root and install png++ into your system:
# make install
It's OK to issue "make install" under ordinary user permissions if you
want to install png++ into your home directory. Run the following
command:
$ make install PREFIX=$HOME
This will copy png++ header files to ~/include/png++ and documentation
files to ~/share/doc/png++-0.2.x (if the docs were built).
These instructions are for building examples which comes with png++. You could create a new VC project and add all source files to this project if you really want to build them (these are not needed if you want to just write your own programs with png++).
Thanks for the prompt reply modoran. Its appreiated.
I was wondering the same what you said and was trying that myself but it also shows many error. Here is what i have been doing. Maybe you can correct me on this.
1: Extract png++.tar
2 : Goto file->new->project from existing code
3: In the project property
a : In configuration properties -> C++ -> general -> additional include directories ->C:\lpng1512\lpng1512 (my libpng location)
b: In configuration properties -> linker-> general -> additional include directories ->C:\lpng1512\lpng1512 (my libpng location)
4: clean
5: build
After the build i have following errors
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\example\pixel_generator.cpp(35) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>convert_color_space.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\convert_color_space.cpp(34) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>dump.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\dump.cpp(4) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>generate_gray_packed.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\generate_gray_packed.cpp(34) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>generate_palette.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\generate_palette.cpp(34) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>read_write_gray_packed.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\read_write_gray_packed.cpp(34) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>read_write_param.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\read_write_param.cpp(4) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>write_gray_16.cpp
1>c:\users\salman\documents\visual studio 2008\projects\png++-0.2.5\test\write_gray_16.cpp(34) : fatal error C1083: Cannot open include file: 'png.hpp': No such file or directory
1>Generating Code...