Page 1 of 1

Problems building on windows

Posted: Fri Apr 11, 2014 5:28 am
by Ian Reed
I removed the HAVE_LIBPNG preprocessor definition as well as UNZIP_SUPPORT, ZLIB, and FMODEX_SUPPORT.
I installed the June 2008 DirectX SDK and the CG stuff from NVIDIA.
I'm running Visual Studio 2010 so the .sln and .csproj files ran through the conversion wizard.

I'm still getting these 2 errors:
Error 1 error C1083: Cannot open include file: 'png.h': No such file or directory C:\Data\Dev\git\snes9x\win32\CD3DCG.cpp 182 1 Snes9X
Error 2 error C1083: Cannot open include file: 'png.h': No such file or directory C:\Data\Dev\git\snes9x\win32\CGLCG.cpp 181 1 Snes9X

Any advice?
Sorry if this is a naive question, C++ is not my core language.

Re: Problems building on windows

Posted: Fri Apr 11, 2014 9:25 am
by OV2
Remove the png.h include line from CD3DCG.cpp, in CGLCG.cpp it should be

Code: Select all

#ifdef HAVE_LIBPNG
#include <png.h>
#endif
You'll also have to remove libpngXXX.lib from the dependency list in the project settings (Linker->Input->Additional Dependencies).

Re: Problems building on windows

Posted: Fri Apr 11, 2014 3:26 pm
by Ian Reed
Thanks. I made the changes you mentioned and now get these 5 errors instead:
Error 1 error C1083: Cannot open include file: 'zlib.h': No such file or directory C:\Data\Dev\git\snes9x\unzip\ioapi.c 13 1 Snes9X
Error 2 error C1083: Cannot open include file: 'zlib.h': No such file or directory C:\Data\Dev\git\snes9x\unzip\iowin32.c 12 1 Snes9X
Error 3 error C1083: Cannot open include file: 'zlib.h': No such file or directory C:\Data\Dev\git\snes9x\unzip\mztools.c 11 1 Snes9X
Error 4 error C1083: Cannot open include file: 'zlib.h': No such file or directory C:\Data\Dev\git\snes9x\unzip\unzip.c 41 1 Snes9X
Error 5 error C1083: Cannot open include file: 'zlib.h': No such file or directory C:\Data\Dev\git\snes9x\unzip\zip.c 17 1 Snes9X
Plus 49 intellisense errors.

I tried surrounding them with:
#ifdef ZLIB
#endif
But that seemed to cause more errors.

Re: Problems building on windows

Posted: Sat Apr 12, 2014 2:58 pm
by Ian Reed
I decided to start over and this time try to build and include zlib as it doesn't seem very optional.
As before I removed FMODEX_SUPPORT and HAVE_LIBPNG and made the 2 changes you mentioned.

I slowly included all the .h files until I got to linker errors.
Then I included each missing .lib file.

Now I get 26 errors similar to this:
error LNK2019: unresolved external symbol _gzclose referenced in function "public: bool __thiscall ConfigFile::LoadFile(char const *)" (?LoadFile@ConfigFile@@QAE_NPBD@Z) Category: Error, Default Order: 38, Description: error LNK2019: unresolved external symbol _gzclose referenced in function "public: bool __thiscall ConfigFile::LoadFile(char const *)" (?LoadFile@ConfigFile@@QAE_NPBD@Z), File: C:\Data\Dev\git\snes9x\win32\conffile.obj, Project: Snes9X

It would seem that my zlibdmt.lib file is missing some expected symbols.
I'm building zlib 1.2.8.
I use the .sln file located in: \contrib\vstudio\vc10
I set the build configuration to release 32 bit.
It builds 6 projects.
I go into x86/ZlibDllRelease and copy zlibwapi.lib to a folder where the SNES9X solution will find it and rename it to zlibdmt.lib.
I expect this process is incorrect since I'm getting missing symbols related to zlib.
Can you tell me what I'm doing wrong?
The how2compile.txt file does not verify what the original name of the .lib would be so I'm not sure I'm renaming the correct file.
It also states that I should compile against VC's multi-threaded C runtime.
I have no idea how to do that, is that an option I change in the zlibvc project properties?

Re: Problems building on windows

Posted: Sat Apr 12, 2014 3:42 pm
by Ian Reed
Well, I just got it building by using the pre-compiled zdll.lib from the ZLIB page.
It seems to work, though it's a debug build.
I'm just happy it works at all though.