Since there is a big vsync problem in mojave i need to update glfw to the latest commit. I downloaded and compiled glfw made a dylib file and added it to my project along with glfw3.h and glfw3native.h. This fails to compile and get the following errors
Reference to ‘Size’ is ambiguous.
Reference to ‘Point’ is ambiguous.
Simple but long option would be adding cocos2d:: before each point/size. Is there any other way to do this?
i compiled glfw into static lib, then replace libglfw3.a in “prebuilt” folder and glfw3.h in “include” folder of cocos2d-x, nothing else, no problems with “ambiguous” errors.
@hexerror hey! thanks for the files. It doesn’t have the vsync fix.
Took me a 1.5 hrs but I included the new glfw by adding cocos2d:: to all Point, Rect and Size. Just to see if the problem is fixed and it is. Gameplay is running perfectly smooth. This was tested on latest macbook 2018.
but above fix is not recommended. I need to make static libraries like you did.
clone glfw git: open terminal, type “git clone https://github.com/glfw/glfw”, wait for clone complete, cd to glfw folder
run cmake gui utility (if dont have it, install from https://cmake.org), press “Browse Source…” and select glfw folder, then press “Browse Build…” and select build folder (i prefer create “bin” folder inside glfw folder), then press “Configure” button, wait for config script complete, on main screen make sure BUIL_SHARED_LIBS unchecked (unchecked by default), set CMAKE_OSX_DEPLOYMENT_TARGET as you wish (my games support osx since osx 10.9), then press “Generate” button.
cd to build folder (“bin” in my example), open GLFW.xcodeproj in xcode, on top of xcode window, next to run and stop buttons, press drop-down projects menu and select “glfw”, then in xcode global menu select Product->build for->Running (for debug build) and Product->build for->Profilling (for release build), wait fo compile, then go to src->Debug(or Release) subfolder, and get fresh libglfw3.a