Sunday, July 6, 2014

Resolving GLEW library when compile Cocos2d-x in Windows 8

This is my second try on compiling Cocos2d-x on Windows platform. Since I have successfully compile for Linux, I'm so eager to try it on Windows. Unfortunately the build were failed. This was happened in few months ago.

In my previous attempt to compile Cocos2d-x on Windows platform happened in few months ago, I was so frustrate that I'm not able to resolve the GLEW library during run-time. I know the root cause, it is either:

  1. the GLEW DLL wasn't there, or
  2. an incompatible GLEW version has been loaded.

A check on the build directory, found out there already have the GLEW DLL, so option 1 is invalid. I downloaded the GLEW library and replace the existing GLEW library and my fate still the same. Failed! Thus option 2 was out. I was running out of clue after many times of try and error, ever wonder which GLEW library did Cocos2d-x were using?

Now a few months later, when I'm looking back on the same problem, I think I'm almost there, just that I have miss out some steps left to be done. As of this writing, I'm using Cocos2d-x 3.1.1 and VS Desktop 2012 Express Edition on Windows 8. This is what I did:

  1. Right click on the project > Properties > Linker tab > General tab > Add the new GLEW library path where the library is downloaded into Additional Library Directories field.
  2. On Linker page again > Input tab > Add glew32.lib into Additional Dependencies field. (Never pick x64 version as it doesn't work.)
  3. Replace the new GLEW DLL with the one located in build path.

Remember not to make a clean build as this will wipe off all the stuff in build directory. If a clean build has accidentally been fired, just replace the GLEW DLL will do.

No comments: