I experienced this same problem yesterday, and found the solution, which (at least in my case, and possibly many others) is related to my ATI video card & drivers.
My display depth was already 32-bit so Siyuan’s suggestion did not help.
I did some research into the Cocos OpenGL ES libs, which come from Khronos/PowerVR, and found this similar thread on their forum:
Coincidentally, I have an ATI Radeon 6850, using 10.12 drivers.
So I uninstalled my 10.12 drivers, and installed Catalyst 10.10 drivers — and my Cocos2d-X project now runs properly!
(okay, I hit a problem in HelloWorld, but Tests.exe runs perfectly for me).
According to Imagination/PowerVR:
Apologies for the slow reply.
This is an issue we have been looking into, and the fix will be in our 2.8 SDK release at the end of Feburary/start of March. We will be making an announcement on the forums and to the POWERVR Insider mailing list when it is available for download.
Hope this helps anyone else that’s experiencing this problem & using newer ATI drivers.