linking errors when compiling 1.53

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Post Reply
ethanscofield
Snes9x White Belt
Posts: 3
Joined: Thu Dec 06, 2018 7:31 am

linking errors when compiling 1.53

Post by ethanscofield »

Hello, I've been trying to compile snes9x 1.53. It's been a headache trying to find all of these old compilers!

At the very end I run into several linking errors.

Code: Select all

1>Linking...
1>libpngdmt.lib(pngerror.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:REF' specification
1>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in zlibdmtu.lib(gzlib.obj)
1>LIBCMTD.lib(vsprintf.obj) : error LNK2005: __vsprintf_l already defined in zlibdmtu.lib(gzlib.obj)
1>LIBCMTD.lib(vsnprint.obj) : error LNK2005: __vsnprintf_l already defined in zlibdmtu.lib(gzlib.obj)
1>LINK : warning LNK4199: /DELAYLOAD:fmod.dll ignored; no imports found from fmod.dll
1>LINK : warning LNK4199: /DELAYLOAD:fmodex.dll ignored; no imports found from fmodex.dll
1>wsnes9x.obj : error LNK2001: unresolved external symbol _CLSID_EnumerableObjectCollection
1>wsnes9x.obj : error LNK2001: unresolved external symbol _CLSID_DestinationList
1>libpngdmt.lib(pngerror.obj) : error LNK2019: unresolved external symbol ___report_rangecheckfailure referenced in function _png_fixed_error
1>zlibdmtu.lib(inftrees.obj) : error LNK2001: unresolved external symbol ___report_rangecheckfailure
1>libpngdmt.lib(pngerror.obj) : error LNK2019: unresolved external symbol ___acrt_iob_func referenced in function _png_default_error
1>libpngdmt.lib(pngerror.obj) : error LNK2019: unresolved external symbol ___stdio_common_vfprintf referenced in function __vfprintf_l
1>zlibdmtu.lib(gzlib.obj) : error LNK2019: unresolved external symbol ___stdio_common_vsprintf referenced in function __vsnprintf_l
1>zlibdmtu.lib(gzwrite.obj) : error LNK2001: unresolved external symbol ___stdio_common_vsprintf
1>zlibdmtu.lib(gzlib.obj) : error LNK2019: unresolved external symbol __twopen referenced in function _open
1>.\snes9x-debug.exe : fatal error LNK1120: 7 unresolved externals
1>Creating browse information file...
Do you have any idea what this could mean? I suspect that it has to do with libpng, but I checked my include/library directories, and my additional library directories for the linker, and it still gives me these errors. I used the prebuilt libpng and zlib files at http://www.s9x-w32.de/dl/

I'd appreciate any help I could get on this, I'm stuck.
ethanscofield
Snes9x White Belt
Posts: 3
Joined: Thu Dec 06, 2018 7:31 am

Re: linking errors when compiling 1.53

Post by ethanscofield »

I forgot to add: I'm using visual studio 2008, and I'm on a 32-bit windows machine.
User avatar
OV2
Official Win32 Porter/Dev
Posts: 679
Joined: Thu Aug 30, 2007 10:15 pm

Re: linking errors when compiling 1.53

Post by OV2 »

Why are you trying to compile 1.53? The compile process has been simplified for newer versions considerably.

The precompiled versions of png and zlib were for later versions of snes9x. If you want to get it to work for 1.53 you can try this:
  • Download zlib 1.2.3 and replace the zlib folder from the precompiled package with its contents (rename the zlib-1.2.3 folder).
  • Compile libpng for the version you want to use by opening libpng\src\projects\visualc71\libpng.vcproj and switching to the right configuration (in your sample case to "LIB Debug" and Win32) and compiling. Copy the output Win32_LIB_Debug\libpngd.lib to libpng\lib\libpngdmt.lib.
  • Compile zlib for the version you want to use by opening snes9x-1.53-src\win32\zlib\zlib.vcproj and switching to the right configuration (in your sample case to "LIB Debug S9xUnicode" and Win32) and compiling.
This should get rid of all errors with libpng and zlib. The _CLSID_EnumerableObjectCollection and _CLSID_DestinationList sound like you are using an older WindowsSDK - s9x requires Windows SDK Version 7.1A.
ethanscofield
Snes9x White Belt
Posts: 3
Joined: Thu Dec 06, 2018 7:31 am

Re: linking errors when compiling 1.53

Post by ethanscofield »

Thank you.
Post Reply