ciplogic/fheroes2enh

Mac OS High Sierra Compile Errors

Closed this issue ยท 6 comments

Firstly thank you working for enhance version ๐Ÿ‘!
I tried to build it in Mac OS X High Sierra(10.13.3) with SDL 1.2.15(installed by brew), copied Data and Maps dirs from original HOMM II, and it succeeded:

[100%] Linking CXX executable fheroes2
[100%] Built target fheroes2

although with some warning(overridden virtual function is here), not a big deal I though :)

then I try to open in terminal(./fheroes2) and it show these errors:

00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] SetLangEnvPath: translation not found: en.mo
libc++abi.dylib: terminating with uncaught exception of type Error::Exception
[1] 94582 abort ./fheroes2

00:14:23: [ERROR] SetLangEnvPath: translation not found: en.mo

Fixed this by change fr lang in cfg file, I think it should load en language by default?

> 00:14:23: [ERROR] open: Couldn't open fheroes2.bin
I searched it in original HOMM II files, but no luck. so where I can get fheroes2.bin file?

Im not not good at the compile jobs, but love this game. Thanks!

Updated:

Using CLion to build the project, "Couldn't open fheroes2.bin" error disappear. And show this:

fheroes2(4899,0x7fff94593340) malloc: *** mach_vm_map(size=140414087675904) failed (error code=3)
error: can't allocate region
set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc

Hi, so let's start with first part:

  • there is folder files in the repository that has to be copied in the same folder where you run FHeroes2. The specific file is under files/save folder
  • if you can run it in Clion and gives errors, may you look where? You should look for "call stack" in DEBUG mode when you run it in CLion.

The error simply states that it cannot allocate memory... with a huge size as parameter. Not sure it is useful to now that if you allocate few thousands of GB, the Mac OS cannot or doesn't want to allocate it

Thanks @ciplogic.

I think fheroes2.bin should be the compiled fheroes2 files, not sure why changed into fheroes2.bin by using make command compile in terminate.

Anyway I will switch to Windows to compile using Visual Studio later. And try to study c++ and compile commands later. :)

@novice87 I tested the build on Mac many times, but on Windows, if you simply don't want to bother to compile, I make from time to time installers.

You can take them from here:
https://github.com/ciplogic/fheroes2enh/releases

@ciplogic Thank you very much.
Actually I don't wanna the installer, I want to build it by my self to learn the code for game development :). maybe you can show me the environment and the compile details.

So I could compile it... on OS X, so I will close the bug.