First post, by emendelson
This question has come up in the past, but I can't find an easy solution. Thanks to advice from Dominus, I was able to build a static-linked DOSBox with screenshot support under OS X, and now I'd like to try doing the same thing with my Win32-based project, which I'm building under Visual C++ 2010 Express.
I downloaded libpng 1.6.5 and zlib 1.2.5 (which is the version that libpng 1.6.5 seems to expect - I haven't figured out how to change 1.2.5 to 1.2.8 in the libpng VC project), and easily built zlib.lib and libpng16.lib, which end up in this directory:
\path\to\my\project\lpng165\projects\vstudio\Release Library
and .obj and other files here:
D:\Development\DOSBoxSVN-unpatched\lpng165\projects\vstudio\libpng\Release Library
In my DOSBox VisualC++ project properties, I added the first path to the top of the Additional Library Directories (under Linker/General) and the second path to the top of Additional Include Directories (under C++/General). In config.h, I defined C_CSSHOT 1.
When I tried to build, I got these errors at the end:
1>hardware.obj : error LNK2019: unresolved external symbol _deflateInit_@16 referenced in function "public: bool __thiscall VideoCodec::SetupCompress(int,int)" (?SetupCompress@VideoCodec@@QAE_NHH@Z)
1>hardware.obj : error LNK2019: unresolved external symbol _inflateInit_@12 referenced in function "public: bool __thiscall VideoCodec::SetupDecompress(int,int)" (?SetupDecompress@VideoCodec@@QAE_NHH@Z)
1>hardware.obj : error LNK2019: unresolved external symbol _deflateReset@4 referenced in function "public: bool __thiscall VideoCodec::PrepareCompressFrame(int,enum zmbv_format_t,char *,void *,int)" (?PrepareCompressFrame@VideoCodec@@QAE_NHW4zmbv_format_t@@PADPAXH@Z)
1>libpng.lib(pngwutil.obj) : error LNK2001: unresolved external symbol _deflateReset@4
1>hardware.obj : error LNK2019: unresolved external symbol _deflate@8 referenced in function "public: int __thiscall VideoCodec::FinishCompressFrame(void)" (?FinishCompressFrame@VideoCodec@@QAEHXZ)
1>libpng.lib(pngwrite.obj) : error LNK2001: unresolved external symbol _deflate@8
1>libpng.lib(pngwutil.obj) : error LNK2001: unresolved external symbol _deflate@8
1>hardware.obj : error LNK2019: unresolved external symbol _inflate@8 referenced in function "public: bool __thiscall VideoCodec::DecompressFrame(void *,int)" (?DecompressFrame@VideoCodec@@QAE_NPAXH@Z)
1>hardware.obj : error LNK2019: unresolved external symbol _inflateReset@4 referenced in function "public: bool __thiscall VideoCodec::DecompressFrame(void *,int)" (?DecompressFrame@VideoCodec@@QAE_NPAXH@Z)
1>libpng.lib(png.obj) : error LNK2001: unresolved external symbol _inflateReset@4
1>libpng.lib(pngwrite.obj) : error LNK2019: unresolved external symbol _deflateEnd@4 referenced in function _png_write_destroy
1>libpng.lib(png.obj) : error LNK2019: unresolved external symbol _crc32@12 referenced in function _png_reset_crc
1>libpng.lib(pngwutil.obj) : error LNK2019: unresolved external symbol _deflateInit2_@32 referenced in function _png_write_IHDR
1>.\Release/dosbox.exe : fatal error LNK1120: 9 unresolved externals
I have no idea of what to do about this, though I see that a similar question came up on the forum about seven years ago, apparently with no clear resolution.
I will be very grateful for any help in sorting this out. Many thanks.