Thank you for the reply, I will try to give you as much information as possible

 

 

Trying to compile after removing “windows.h” from “freeglut_std.h” gave me a total of 7293 errors, compared to 31 with the line present (not counting possible errors that would pop up if it went past the windows.h part)

Skimming through these errors, it seems like they are all from gl.h, and most of them are repeated many times

Here is a small sample

 

 

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1153) : error C2086: 'int WINGDIAPI' : redefinition

        c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1152) : see declaration of 'WINGDIAPI'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1153) : error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'

c:\program files\microsoft visual studio 8\vc\include\gl\gl.h(1153) : error C2182: 'APIENTRY' : illegal use of type 'void'

 

 

It seems like OpenGL for windows needs to have windows.h included in order to work, and it is called a few lines after windows.h in freeglut_std.h, therefore I believe the #include <windows.h> line would have to remain in there.

 

As for the errors/warnings when this line is included, they are mostly warnings about the wrong type of variables being sent to the freeglut functions (ex: 'initializing' : conversion from 'GLdouble' to 'float', possible loss of data) and one on a call to the function ShellExecute from Windows, which would seem to point to the fact that all Windows functions were not included in this build.

 

I tried to create a new project from scratch and to add my headers and source files to get rid of the MFC part, but it seems I’m as far from MFC as I can be.

 

I created the new project as a “Windows Console” program, not MFC, and the project properties regarding MFC were the same, “Use of MFC: Use standard Windows librairies”

 

I don’t think I need MFC, but since I’m not the original creator of this code I can’t certify that 100% (doing maintenance currently). I’d like to get rid of the MFC part which seems to be the issue here, but can’t seem to be able to do that.

 

 

That sums up about all I know concerning this issue at present.

 

Thanks again for your help

 

 

Pascal Savard

Pascal.Savard@nrc-cnrc.gc.ca

Institute for Information Technology / Institut de technologie de l'information

National Research Council / Conseil national de recherches du Canada

M-50, 1200 Montreal Road / M-50, 1200, chemin Montréal

Ottawa, Ontario

K1A 0R6

 

-----Original Message-----
From: freeglut-developer-bounces@lists.sourceforge.net [mailto:freeglut-developer-bounces@lists.sourceforge.net] On Behalf Of Fay John F Dr CTR USAF AFSEO/SK
Sent: January 18, 2007 3:41 PM
To: 'FreeGLUT developers list'
Subject: Re: [Freeglut-developer] Multithreaded on Windows

 

Pascal,

        Hello and welcome to the "freeglut" community.

        I don't think we have ever tried building "freeglut" in a multi-threaded mode.

        The first thing I see is that you are also compiling an MFC application.  MFC is its own windowing system, I think; I don't know that we have ever run "freeglut" on MFC either.  So there are two unknowns here.

        All that said, I am one of the primary maintainers of "freeglut" and am active on the Windows side, and am interested in helping if possible.  So I don't think you are wasting your time here; at the very least, I would like to see to it that you aren't.

        We will not be able to remove it based on a test for "_WINDOWS_" because MSVC6 will still need it.  But that is a detail that we will be able to handle later.

        What are the errors you get when you remove "windows.h" from "freeglut_std.h"?

John F. Fay
Technical Fellow
Jacobs/Sverdrup TEAS Group
850-883-1294

-----Original Message-----
From: freeglut-developer-bounces@lists.sourceforge.net [mailto:freeglut-developer-bounces@lists.sourceforge.net] On Behalf Of Savard, Pascal

Sent: Thursday, January 18, 2007 1:24 PM
To: freeglut-developer@lists.sourceforge.net
Subject: [Freeglut-developer] Multithreaded on Windows

Hello

 

I've been maintaining an application for a few months. This application uses OpenGL and GLUT to handle the graphical part.

 

Last week we migrated the application from MS Visual Studio 6 to MS Visual Studio 8 (2005).

 

The problem I'm facing now is that MSVC8 has completely removed the Single threaded compilation option.

 

As far as I can see, the application compiles and works like that while in Debug mode, but we receive linking errors on every GLUT function when we compile in Release mode.

 

I have therefore begun searching for an alternative to GLUT which would let us compile in Release mode using MSVC8. This is how I found freeglut.

 

I did some research and couldn't find the answers to my questions, so here it goes

 

Does freeglut support multithreaded compilation? I tried to replace GLUT with freeglut in my application, but cant seem to get it working because of an error

 

c:\program files\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error :  WINDOWS.H already included.  MFC apps must not #include <windows.h>

 

The windows.h file was already included to the project prior to switching to freeglut, and didn't give us any problems.

 

I tried putting every declaration between #ifndef _WINDOWS_  and get the same error.

Removing the declaration from either that afxv_w32.h or freeglut_std.h both generate a bunch of errors.

 

 

So am I wasting my time? If freeglut does support multithreaded I'd like to get it to work, but if not ill have to find another alternative to using the GLUT-based libraries.

 

Thanks for your help

 

 

Pascal Savard

Institute for Information Technology / Institut de technologie de l'information

National Research Council / Conseil national de recherches du Canada

Ottawa, Ontario