hey I finally got vcmi to run on Mac . here is a list of issues I encountered, maybe it will help someone.
1.did a autoreconf -i to reconfigure the makefiles
-
./configure wouldn’t work because of some missing libraries. I used both MacPorts and Homebrew to get that dependencies.
-
commented out a few lines to get the code to compile. I will get back to those and try to fix them to work for mac. Here are the issues :
CVideoHandler.cpp: In member function ‘bool CVideoPlayer::playVideo(int, int, SDL_Surface*, bool)’:
CVideoHandler.cpp:965: error: ‘GH’ was not declared in this scope
// Plays a video. Only works for overlays.
bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
{
// Note: either the windows player or the linux player is
// broken. Compensate here until the bug is found.
y--;
pos.x = x;
pos.y = y;
while(nextFrame()) {
if(stopOnKey && keyDown())
return false;
SDL_DisplayYUVOverlay(overlay, &pos);
// Wait 3 frames
//--CT commented those out so it will compile on Mac
//GH.mainFPSmng->framerateDelay();
//GH.mainFPSmng->framerateDelay();
//GH.mainFPSmng->framerateDelay();
}
return true;
}
CXXLD vcmiclient
ld: library not found for -lrt
removed the -lrt flag from the client/Makefile.am
vcmiclient_LDADD = $(top_builddir)/lib/libvcmi.la @SDL_LIBS@ @FFMPEG_LIBS@ @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_SYSTEM_LIB@ @BOOST_FILESYSTEM_LIB@ @BOOST_THREAD_LIB@ @BOOST_IOSTREAMS_LIB@ -lz
CGameHandler.cpp: In member function ‘void CGameHandler::spawnWanderingMonsters(int)’:
CGameHandler.cpp:5527: error: no matching function for call to ‘CCreature::getRandomAmount(int ()()) const’
../lib/CCreatureHandler.h:67: note: candidates are: int CCreature::getRandomAmount(RanGen&) const [with RanGen = int ()()]
void CGameHandler::spawnWanderingMonsters(int creatureID)
{
std::vector<int3>::iterator tile;
std::vector<int3> tiles;
getFreeTiles(tiles);
ui32 amount = (tiles.size()) >> 6;
std::random_shuffle(tiles.begin(), tiles.end(), p_myrandom);
tlog5 << "Spawning wandering monsters. Found " << tiles.size() << " free tiles. Creature type: " << creatureID << std::endl;
const CCreature *cre = VLC->creh->creatures[creatureID];
for (int i = 0; i < amount; ++i)
{
tile = tiles.begin();
tlog5 << "\tSpawning monster at " << *tile << std::endl;
//--CT
//putNewMonster(creatureID, cre->getRandomAmount(std::rand), *tile);
tiles.erase(tile); //not use it again
}
}
CEmptyAI.h:9: error: expected class-name before '{' token
CEmptyAI.h:17: error: expected ',' or '...' before '&' token
CEmptyAI.h:17: error: ISO C++ forbids declaration of 'TryMoveHero' with no type
CEmptyAI.h:19: error: 'CSelectableComponent' was not declared in this scope
CEmptyAI.h:19: error: template argument 1 is invalid
CEmptyAI.h:19: error: template argument 2 is invalid
CEmptyAI.cpp: In member function 'void CEmptyAI::init(CCallback*)':
CEmptyAI.cpp:7: error: 'human' was not declared in this scope
CEmptyAI.cpp:8: error: 'playerID' was not declared in this scope
CEmptyAI.cpp: At global scope:
CEmptyAI.cpp:21: error: expected ',' or '...' before '&' token
CEmptyAI.cpp:21: error: ISO C++ forbids declaration of 'TryMoveHero' with no type
make[3]: *** [libEmptyAI_la-CEmptyAI.lo] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
changed
#include "../../AI_Base.h"
to
#include "../../lib/AI_Base.h"
- after i did a make install and copied over the data ,mp3 the maps folder, it worked!.
I get an error which keesp repeating itself on the console :
2011-12-30 11:41:57.603 vcmiclient[17931:6107] *** __NSAutoreleaseNoPool(): Object 0x119ded500 of class NSWindowGraphicsContext autoreleased with no pool in place - just leaking
- TODO. Need to get it in an IDE so it will be easier to compile, debug and source control.