Search code examples
openglluacross-platformprojectpremake

Build project file with premake4 - how to?


Based on http://arcsynthesis.org/gltut/Building%20the%20Tutorials.html - the book Im reading to learn openGL, I need to build my file projects with premake4. The book says:

"The SDK his library uses Premake to generate its build files. So, with premake4.exe in your path, go to the glsdk directory. Type premake4 plat, where plat is the name of the platform of choice. For Visual Studio 2008, this would be “vs2008”; for VS2010, this would be “vs2010.” This will generate Visual Studio projects and solution files for that particular version."

So, I've put the premake4.exe file inside but the problem is: When I execute it, one black command window shows up for a few ms, then fades and nothing happens.

I made one research on google about how to work with premake4 but I couldnt find nothing useful, even here on stack or you tube. Anyway, This seems weard since premake4 is really known, then I ask: Does anyone know what Im missing or could point me to somewhere which I can understand how to build my openGL "sdk" files?

Im using premake 4.3 with Windows 8.

Edit: I just found someone with the same problem - but the solution isnt really applying for me: Can't get premake working - gltut demos

Edit 2: Found once again someone with the same problem, but this no solution on the topic and also the OS is different from mine.. http://industriousone.com/topic/terminal-logout-when-running-premake4exe

enter image description here


Solution

  • As it says in the documentation you quoted:

    Type premake4 plat, where plat is the name of the platform of choice. For Visual Studio 2008, this would be “vs2008”; for VS2010, this would be “vs2010.”

    Just running it with no arguments (which is what double-clicking on it does) is not sufficient. You need to open a command prompt, cd to the directory the project is in, and then run premake4 vs2008 (replacing vs2008 with the name of the platform you're targeting).

    The most recent version of Visual Studio supported by Premake is 2010, so for later versions, you'll still have to use premake vs2010 - later versions of VS should still be able to load the project.