Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Compiling Meka under Visual Studio 2015 Community

Reply to topic
Author Message
  • Joined: 16 Sep 2016
  • Posts: 8
Reply with quote
Compiling Meka under Visual Studio 2015 Community
Post Posted: Mon Feb 27, 2017 4:04 pm
I love Meka it's my favorite SMS emulator still many years running. I want to tinker around with the source under Windows 10 (I'm running on a late 2015 i5 MacBook Pro that I've got Windows 10 on via Bootcamp) in VS2015 Community.

I also want it using all compiled dependencies because I may want to use libpng and zlib in other projects.

Side TLDR: Possibly not allegro though, I think all of us who've ever used allegro are aware of its shortcomings. I tried to port Meka to iOS a few months back by trying to port the OSX XCode project to iOS and actually got a working main GUI screen on my iPhone but had lots of issues with reading in images from resources on iOS it likes to read past the end of file and throw up garbage on the screen, and other issues. After doing some work in the OSX and Linux worlds for a while, I like Windows better anyway, maybe I'll just find a cheap discontinued AT&T Nokia Lumia 650 online and swap my SIM into it periodically and port Meka over to Windows 10 Mobile. Sounds like a better solution. :-P

After doing some changes to the source, namely I deleted references to HQ2X since it wouldn't compile, also I changed zlib.lib to zlibstat.lib to match my system, and removed the jpeg.lib reference, I'm getting some linker errors on the zlib part:


1>------ Build started: Project: Meka, Configuration: Debug Win32 ------
1>checksum.obj : error LNK2019: unresolved external symbol _crc32 referenced in function "void __cdecl Checksum_Perform(unsigned char const *,int)" (?Checksum_Perform@@YAXPBEH@Z)
1>unzip.obj : error LNK2001: unresolved external symbol _crc32
1>unzip.obj : error LNK2019: unresolved external symbol _inflate referenced in function _unzReadCurrentFile
1>unzip.obj : error LNK2019: unresolved external symbol _inflateEnd referenced in function _unzCloseCurrentFile
1>unzip.obj : error LNK2019: unresolved external symbol _inflateInit2_ referenced in function _unzOpenCurrentFile
1>..\..\..\objs\meka\Debug\mekaw.exe : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Here are my linker additional paths:
C:\Users\John\Documents\OtherSources\zlib1211\zlib-1.2.11\contrib\vstudio\vc14\x86\ZlibStatDebug;
C:\Users\John\Documents\OtherSources\lpng1628\lpng1628\projects\vstudio\Debug;
C:\Users\John\Documents\Git\freetype\objs\vc2010\Win32;
../../../libs/allegro/lib/;
../../../libs/allegro_deps/lib/;
$(DXSDK_DIR)/lib/x86;
%(AdditionalLibraryDirectories)

Here are the linker additional dependencies:
zlibstat.lib;
allegro.lib;
allegro_font.lib;
allegro_primitives.lib;
allegro_image.lib;
allegro_audio.lib;
freetype26d.lib;
libpng16.lib;
kernel32.lib;
user32.lib;
gdi32.lib;
gdiplus.lib;
comdlg32.lib;
comctl32.lib;
ole32.lib;
winmm.lib;
shlwapi.lib;
psapi.lib;
opengl32.lib;
dxguid.lib;
d3d9.lib;
%(AdditionalDependencies)

Here are the C++ additional include paths:
C:\Users\John\Documents\OtherSources\zlib1211\zlib-1.2.11;
../..;
../../../libs/allegro/include/;
../../../libs/allegro_deps/include/;
%(AdditionalIncludeDirectories)

libpng version 1.6.28 (Sourceforge)
zlib version 1.2.11 (Sourceforge)
freetype version 2.7 (Git)
Allegro and Meka are from Git as of Saturday

I'm totally stumped on this one, all of the paths seem right, everything should be working fine. The zlib I have is being used in libpng and compiled just fine. I've been stumped for a couple of days and getting heavy resistance. What am I missing to resolve those linker errors?
  View user's profile Send private message
  • Joined: 16 Sep 2016
  • Posts: 8
Reply with quote
Post Posted: Mon Feb 27, 2017 6:05 pm
Answered my own question.

According to this article http://stackoverflow.com/questions/5424549/unresolved-externals-despite-linking-in-zlib-lib you need to add #define ZLIB_WINAPI if using newer versions of zlib if compiling with the most recent VS projects for zlib. Add those #defines to Meka's source in checksum.c, unzip.c, and others that need to use zlib's functionality.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Mon Feb 27, 2017 9:55 pm
Does my VS2015 fork work in Community? It pulls dependencies from NuGet.
  View user's profile Send private message Visit poster's website
  • Joined: 20 Apr 2017
  • Posts: 1
Reply with quote
Post Posted: Thu Apr 20, 2017 9:38 pm
Maxim wrote
Does my VS2015 fork work in Community? It pulls dependencies from NuGet.

Maxim, I can confirm it works perfectly. Thanks for the VS2015 fork. I used it in creating a Meka fork allowing SMS support on retroachivements.org.

I felt I should stop by and say thanks.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14690
  • Location: London
Reply with quote
Post Posted: Fri Apr 21, 2017 6:23 am
I noticed that - I wonder if we can get it into baseline Meka?
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!