engine-sim icon indicating copy to clipboard operation
engine-sim copied to clipboard

Build Error: 'malloc.h' file not found

Open yasinarik opened this issue 2 years ago • 8 comments

What a fascinating project! Thanks for making it public. I immediately wanted to try it out!

However, I am not familiar with C++ so it might be because of my lack of experience.

I have followed the instructions I get an error like that:

fatal error: 'malloc.h' file not found
#include <malloc.h>
         ^~~~~~~~~~
1 error generated.
make[2]: *** [dependencies/submodules/delta-studio/CMakeFiles/delta-core.dir/src/yds_animation_action.cpp.o] Error 1
make[1]: *** [dependencies/submodules/delta-studio/CMakeFiles/delta-core.dir/all] Error 2
make: *** [all] Error 2

I am using macOS btw.

When I do a search about #include <malloc.h> I see that people suggest just using #include <stdlib.h> instead.

The error happens on this file: dependencies/submodules/delta-studio/include/yds_allocator.h

How to resolve this issue?

yasinarik avatar Aug 10 '22 14:08 yasinarik

The app is only available for windows, you might be able to compile it but if you are trying to compile it to use the application on MacOS then you're wasting time.

BoogieHasFun avatar Aug 10 '22 16:08 BoogieHasFun

The app is only available for windows, you might be able to compile it but if you are trying to compile it to use the application on MacOS then you're wasting time.

Oh no :(

So that is the case then. I wish there is a stand-alone install only release.

Btw, I couldn't see anything that indicates that the app is only for Windows platform.

Anyways, thanks for replying.

yasinarik avatar Aug 10 '22 18:08 yasinarik

on line 40 of the read me it states "Note: this project currently only builds on Windows!"

BoogieHasFun avatar Aug 10 '22 18:08 BoogieHasFun

if your desperate to try it out you can always use a windows virtual machine (intel macbooks only)

(or as someone stated utm is a option)

BoogieHasFun avatar Aug 10 '22 18:08 BoogieHasFun

We have some people working on a Linux port and there may be a Mac port at some point, but at the moment it only natively supports Windows.

ange-yaghi avatar Aug 11 '22 22:08 ange-yaghi

@BoogieHasFun FYI there's also UTM (https://mac.getutm.app/), which allows you to run x86 on M1-based Macs (and some ARM64 OSes on x86). It's free and open-source. There is some performance loss, but I was surprised at how responsive W10 x64 was on an M1 running under UTM.

bsharper avatar Aug 12 '22 17:08 bsharper

@BoogieHasFun FYI there's also UTM (https://mac.getutm.app/), which allows you to run x86 on M1-based Macs (and some ARM64 OSes on x86). It's free and open-source. There is some performance loss, but I was surprised at how responsive W10 x64 was on an M1 running under UTM.

Wow this is the reward of the day! Thanks a lot. I will probably need UTM anyways for other things to test on Windows! Appreciated:)

yasinarik avatar Aug 12 '22 17:08 yasinarik

@BoogieHasFun FYI there's also UTM (mac.getutm.app), which allows you to run x86 on M1-based Macs (and some ARM64 OSes on x86). It's free and open-source. There is some performance loss, but I was surprised at how responsive W10 x64 was on an M1 running under UTM.

i forgot about UTM

BoogieHasFun avatar Aug 12 '22 17:08 BoogieHasFun

It's possible just changing to stdlib.h will solve the issue. I'll see if I have time to try it out but any other mac user might get to it before me.

gbwiersum avatar Aug 17 '22 17:08 gbwiersum

I am also interested in getting this to build on Mac (even if the end build will still only be usable via a wine bottle or a VM). Will see what further issues appear other than malloc.h.

preland avatar Aug 29 '22 14:08 preland

@gbwiersum That's not the only needed change. I'm on Mac-M1 and get error: use of undeclared identifier '__builtin_ia32_punpckhwd'. There is more stuff to be changed.

andreyluiz avatar Aug 30 '22 19:08 andreyluiz

@bsharper UTM also doesn't work very well. The processing power is not near sufficient to run the simulator efficiently. Also, there are plenty of issues with the UI and the shortcuts (some keys won't respond to key up). So I think it's not an option as well.

andreyluiz avatar Aug 30 '22 20:08 andreyluiz

worked on parallels desktop for me but the performance is not good enough

Simsalaba avatar Sep 21 '22 11:09 Simsalaba

Closing as duplicate of https://github.com/ange-yaghi/engine-sim/issues/2

Jckf avatar Oct 01 '22 11:10 Jckf