Unable to get Urho3D built on Mac

I just found out about Urho3D and I’ve been trying to get it built on my Mac. I’ve run ./cmake_macosx.sh osx-Build -DURHO3D_SAMPLES=1 in the root folder (I checked out the source from github) and the build completes without a hitch. But when I open the resulting Urho3D.xcoderpoj and try to build the ALL_BUILD target, I get the following error: "‘AssimpPCH.h’ file not found. I was wondering if anybody could point me in the right direction to get the build working. Thanks.

I just build it the other day on Yosemite , it builds perfectly fine. You need to install command-lines tools with Xcode and cmake .

Done that. I didn’t get past the first part without command-line tools. But as I said, I’ve opened the resulting xcode project file in xcode, but that won’t build

Possibly you have checked out the master branch at the bad time. There was an Xcode build error caused by a recent PR which is now already resolved. So you may want to do another git pull first before retrying.

Just did a pull and started from a clean slate. Redid everything from scratch, but still getting the same error :frowning:

Did you also delete the old build tree?

Yup, removed the whole osx-Build directory and ran cmake again with “./cmake_macosx.sh osx-Build -DURHO3D_SAMPLES=1”

This is strange. Earlier our Xcode CI builds did flag up build error caused by the recent change in the PCH handling introduced by a PR. A correction was made and all our Xcode CI builds are running fine since then. I am also not able to reproduce your error in my Mac OS X VM. I am using xcodebuild command line to build the generated project (as does our CI build). However, that should not make any differences with building it with Xcode IDE.

BTW, I always create my build-tree outside of the Urho3D project root. Try that and see it makes any difference.

Tried the latest version of cmake (earlier I used homebrew installed 3.1) and building outside of main Urho3d project root. Still failing. Going to try xcodebuild next

Getting the same error from xcodebuild (running it without any command line arguments).

CompileC /Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/Objects-normal/x86_64/AssimpPCH.o Source/ThirdParty/Assimp/code/AssimpPCH.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/tinimini/Development/Urho3D
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x c++ -arch x86_64 -fmessage-length=181 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fcolor-diagnostics -Wno-trigraphs -fpascal-strings -O3 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR=\"Release\" -DURHO3D_SSE -DURHO3D_FILEWATCHER -DURHO3D_PROFILING -DURHO3D_LOGGING -DKNET_UNIX -DURHO3D_OPENGL -DGLEW_STATIC -DGLEW_NO_GLU -DURHO3D_ANGELSCRIPT -DURHO3D_NAVIGATION -DURHO3D_NETWORK -DURHO3D_PHYSICS -DURHO3D_URHO2D -DURHO3D_STATIC_DEFINE -DHAVE_STDINT_H -DASSIMP_BUILD_BOOST_WORKAROUND -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -fasm-blocks -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -mmacosx-version-min=10.10 -Wno-sign-conversion -I/Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Release/include -I/Users/tinimini/Development/Urho3D-OSX/include -I/Users/tinimini/Development/Urho3D-OSX/include/Urho3D/ThirdParty -I/Users/tinimini/Development/Urho3D-OSX/include/Urho3D/ThirdParty/Bullet -I/Users/tinimini/Development/Urho3D/Source/ThirdParty/Assimp/include -I/Users/tinimini/Development/Urho3D/Source/ThirdParty/Assimp/code/BoostWorkaround -I/Users/tinimini/Development/Urho3D/Source/ThirdParty/Assimp/contrib/unzip -I/Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/DerivedSources/x86_64 -I/Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/DerivedSources -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -F/Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Release -Wno-invalid-offsetof -ffast-math -m64 -DNDEBUG -include AssimpPCH.h -MMD -MT dependencies -MF /Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/Objects-normal/x86_64/AssimpPCH.d --serialize-diagnostics /Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/Objects-normal/x86_64/AssimpPCH.dia -c /Users/tinimini/Development/Urho3D/Source/ThirdParty/Assimp/code/AssimpPCH.cpp -o /Users/tinimini/Development/Urho3D-OSX/Source/ThirdParty/Assimp/Urho3D.build/Release/Assimp.build/Objects-normal/x86_64/AssimpPCH.o
In file included from <built-in>:328:
<command line>:19:10: fatal error: 'AssimpPCH.h' file not found
#include "AssimpPCH.h"

Which Xcode version do you have? The version used on Travis CI VM is 6.1 and on my personal VM is 5.1.1. If yours is higher than 6.1 then there could be a possibility Apple has improved AppleClang which flags up new issues with our code. If so, perhaps your next course of action is to test by reverting recent changes on using PCH for Assimp library. Comment out the line which says “enable_pch()” in the Source/ThirdParty/Assimp/CMakeLists.txt and rebuild again to see how it goes.

I’m using 6.3. I will try what you suggested and see if that helps

Haa! That seemed to have done the trick. I got it built now. Am able to run the samples now, getting some “check the documentation on how to set the ‘resource prefix path’” errors when launching them, but I will figure them out. Thanks for your help!

Ok, I just copied the CoreData and Data folders to my bin folder in my build directory and the samples work now. Now I have a lot of studying to do! :slight_smile:

Glad to hear that. You may help to raise this as an issue in our GitHub issues tracker so we don’t forget about fixing this properly later.

Sure thing!

Here you go: github.com/urho3d/Urho3D/issues/709

Could you help me to do one more thing since I don’t have latest Xcode to experiment with. Can you temporarily revert back the change that I told you earlier but instead comment out the lines being highlighted here github.com/urho3d/Urho3D/blob/m … #L663-L665. Rebuild and let us know the result. Thanks.

Absolutely! I’ll get back to you once I have the time to try it out.