Using codeblocks 13.12 on windows 7 with mingw compiler.
Trying to compile the libpng library and its zlib dependency. Have both folders (libpng1616\ and zlib-1.2.8\ ) under "C:\...\mylibs\".
Imported the vstudio .sln file after specifying the relative path of zlib in the file "lpng1616\projects\vstudio\zlib.props". Importing spawns several codeblocks project files under the folders in "libpng1616\projects\vstudio\". 7 Projects but I'm only interested in compiling first zlib and then libpng (which should link to zlib).
The problem is when compiling (zlib project) the zlib source locations are not found. This is also indicated by broken .c file icons under the sources folder. It seems codeblocks literally copies the string $ZLibSrcDir as a path. Nowhere in the settings can I find where this variable is specified (it should be ..\..\..\..\zlib-1.2.8 since the project is in "lpng1616\projects\vstudio\zlib\zlib.cbp")
After manually:
- removing the non-existing source dir
- adding the eleven .c files
- specifying that it is a static library in build options
the zlib project compiles into "libzlib.a" without errors.
Going on to compile libpng project I had to change the linked library (it referred to libz.lib in the non-existing directory) to my new libzlib.a file. Then set the compiler search directory to the proper zlib folder. Added the pnglinconf.h file to "mylibs\pnglib1616\" and voila i got a working libpng.a file.
Tested succesful with the pngtest project, which also required first tweaking build options and copying a png file to the project directory.
I dont understand why every project has 4 build targets instead of 2 (debug/release), each has a library win32 and a win32 version. I also dont get why they don't offer precompiled files for windows to download.
But my question is: is there an easier way to make these libraries (with CB, not MSYS or cygwin or MSVS). And if not is there a tool that helps better convert the .sln to .cbp projects?