facebookarchive / RakNet

RakNet is a cross platform, open source, C++ networking engine for game programmers.
Other
3.29k stars 1.02k forks source link

build failed on os x #108

Open bin-zhao opened 7 years ago

bin-zhao commented 7 years ago

OS X version: 10.11.6 GCC version: Apple LLVM version 8.0.0 (clang-800.0.42.1) Bash command: gcc -c -I ../Include -isysroot ./build/macosx10.11/ -arch i386 *.cpp Fatal error:

In file included from ./RakMemoryOverride.h:30:
./RakAlloca.h:18:10: fatal error: 'malloc/malloc.h' file not found
#include <malloc/malloc.h>
         ^
1 error generated.
In file included from BitStream.cpp:20:
In file included from ./BitStream.h:24:
In file included from ./RakMemoryOverride.h:30:
./RakAlloca.h:18:10: fatal error: 'malloc/malloc.h' file not found
#include <malloc/malloc.h>
         ^
1 error generated.
In file included from CCRakNetSlidingWindow.cpp:11:
In file included from ./CCRakNetSlidingWindow.h:47:
In file included from ./RakNetTypes.h:29:
./SocketIncludes.h:54:11: fatal error: 'unistd.h' file not found

etc.
Luke1410 commented 6 years ago

I tested this a few weeks ago and didn't run into this issue. This sounds like a configuration issue on your build environment to me. Can you confirm that you get the issue when building RakNet using the cmake generated project files?

phoenixgou commented 6 years ago

@Luke1410 I encountered the same problem on osx 10.12.6 Can not find file for <malloc / malloc.h> I found the osx system and found that there is no one place to have this file. I ask you how to get this file? thanks first!~

Luke1410 commented 6 years ago

@phoenixgou / @bin-zhao Try to substitute line 18 in RakAlloc.h with this one:

include

Does that solve the compile error for you?