From mac to windows: god bless opengl!

Yesterday I decided to compile my current project in windows. I didn't know if it was going to bring me too much trouble, as it was the first time I developed in one platform (mac) and then compiled for another (windows). So I turned on my old laptop, opened visual C and created a new Win32 Console application (as here in the mac version I'm creating a simple binary which you can execute from a terminal window).

I downloaded fmod's pack for having the .lib and the .dll, and then I realized that the graphics framework I was using, glfw, didn't provide a precompiled .lib or .dll, so I had to compile it. Luckily, there was a makefile for visual C so I didn't had to figure anything (I am quite bad trying to do build scripts).

Once I discovered that I didn't had the appropriate enviroment variables set up for using visual c from command line, I remembered there was a .bat file called vcvars.bat or something like that, which prepares all the paths and routes so you can start running nmake without any problem. So, I executed that and I got my glfw dll and lib, next step was adding the .lib to the project and trying to compile.

But I had forgotten to add two important libraries: opengl32.lib and glu32.lib, which are the equivalent to mac's OpenGL.framework. So I added them and then it compiled perfectly without no errors! Demo ran smoothly and as expected... no need to change anything in the code (as all the window initialization is done via glfw's functions, and fmod is multiplatform).

Only difference is that for windows I use dll's so the final executable size is smaller, while in the mac version everything gets statically linked and thus the size of the exe is way bigger (let's say ~750 kb for mac, ~150 for windows). But I prefer to have it statically for demos... that way there's no possibility of forgetting a dll when submitting for a compo! :D