Compiling under Microsoft Visual C++ Express?

nobody wrote on Thursday, April 21, 2005:

Im having troubles compiling with this compiler. I read the read me carefully and did all the steps but when I run vcvar32.bat and am in the GLFW directory and type nmake win32-msvc I get the follwing error:

Files\Microsoft was unexpected at this time.
NMAKE : fatal error U1077: ‘.\\compile.bat’ : return code ‘0xff’ Stop.

Is the problem with the newer version of visual c++ or is there something im overlooking? BTW I also tried compiling the makefile and it displayed an error that basically said:

Cannot open include file: 'windows.h’
Thanks for any help.

marcus256 wrote on Friday, April 22, 2005:

Try running the compile.bat file by itself like this:

compile.bat nmake msvc

See if that works…

nobody wrote on Friday, April 22, 2005:

Alright I tried that and i started to compile but then I recieved an error that said:
Microsoft (R) Program Maintenance Utility Version 8.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

    cl /nologo /c /O1sgiy /Gs /W3 /I. /I.. /Foenable.obj ..\\\enable.c

cl : Command line warning D9035 : option ‘Og’ has been deprecated and will be re
moved in a future release
cl : Command line warning D9035 : option ‘Gs’ has been deprecated and will be re
moved in a future release
enable.c
platform.h(45) : fatal error C1083: Cannot open include file: ‘windows.h’: No su
ch file or directory
NMAKE : fatal error U1077: ‘cl’ : return code '0x2’
Stop.

Microsoft (R) Program Maintenance Utility Version 8.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.

    cl /nologo /Ox /I..\\\include /Fetriangle.exe triangle.c ..\\\lib\\\win32\\\

glfw.lib opengl32.lib glu32.lib user32.lib /link /subsystem:windows /entry:mainC
RTStartup
triangle.c
…\\include\GL\glfw.h(167) : fatal error C1083: Cannot open include file: ‘GL/gl
.h’: No such file or directory
NMAKE : fatal error U1077: ‘cl’ : return code '0x2’
Stop.

nobody wrote on Thursday, August 18, 2005:

Hey,

Doesn’t appear to be isolated for VC++ Express, I’m getting the same.

–CJM

nobody wrote on Thursday, August 18, 2005:

Hey,

Just thought I should try to elaborate a bit [for everyone’s info, if anyone’s interested]. Under VC++ Express, the platform SDK isn’t installed by default, so things like <windows.h>, <gl.h> etc aren’t installed.

I have installed the platform SDK, but by default in VC did not have access to the actual h files and whatnot, gaining access involved copying a directory around. That said, the makefile appears not to be able to find the directory containing <windows.h> and <gl.h>. This can easily be hackishly fixed by specifying explicitly the include directory within the files that you get the errors in [platform.h and glfw.h, but these files then use the <> notation to access their includes which appear to all be in the same directory].

All in all, I think it’s just a case of editing the makefile to look for files in the platform SDK’s directory.

Hope this helps
–CJM

nobody wrote on Sunday, August 21, 2005:

Not to triple post,

It should be relatively straigtforward just to create a new project set up for generating a dll and a lib from inside VC++2005. Just make sure that you add user32.lib and opengl.lib, and only include the base directory and the win32 directory. Similarly, in the additional include directories, you’ll need to point to both the lib dir and the lib\win32 dir. Then you should get painless builds a plenty.

After sitting down and looking at it for 5 minutes, the solution [bad pun] seemed to be the most straightforward way to solve the problem, because VC recognises the platform SDK directories from inside the gui, but not from nmake.

–CJM

nobody wrote on Sunday, August 21, 2005:

Ok, this is just turning into spamming - but I’m not a member and can’t edit or anything.

Unless your needs are specific [ie recompiling the entire library with changes] then you don’t really need to actually even make anything for MSVC. Just grab the dll from support, and the linker file from the MASM stuff - they use the same format, so it’ll all run good.

Last post, I promise
–CJM