Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: relsoft on September 28, 2010

Title: GLFW(or SDL)+OPENGL in VS express help....
Post by: relsoft on September 28, 2010

I started using MSVS express and with the help of lazy foo's tutorial, I was able to make an SDL app working.

However, after I started to add opengl, I get a plethora of errors related to the gl.h header.  The errors in both SDL and GLFW are the same so I'm posting the GLFW example here:

Code: [Select]
// GLFW_test.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include    <GL/gl.h>
#include    <GL/glu.h>
#include    <GL/glfw.h>
#include    <stdlib.h>

 int  main(   void   )
 {
      int  running    = GL_TRUE;

      //  Initialize    GLFW
      if (  !glfwInit()    )
      {
           exit(   EXIT_FAILURE     );
      }

      //  Open   an OpenGL   window
      if (  !glfwOpenWindow(      300,300,   0,0,0,0,0,0,     GLFW_WINDOW     ) )
  {
           glfwTerminate();
           exit(  EXIT_FAILURE    );
      }

      //  Main  loop
      while (  running   )
      {
           // OpenGL   rendering   goes  here...
           glClear(   GL_COLOR_BUFFER_BIT     );

           // Swap   front  and  back  rendering   buffers
           glfwSwapBuffers();

           // Check   if ESC  key  was  pressed   or  window  was  closed
           running   = !glfwGetKey(    GLFW_KEY_ESC    ) &&
                       glfwGetWindowParam(     GLFW_OPENED    );
      }

      //  Close  window  and  terminate    GLFW
      glfwTerminate();

      //  Exit  program
      exit(  EXIT_SUCCESS    );
 }

Project Properties:

Quote

Detect 64 bit Portability Issues = No

Code Generation:
     Runtime Library: Multi-threaded (/MT) for GLFW, Multi-threaded DLL(/MD) for SDL

Linker:
     Additional dependencies: opengl32.lib glu32.lib GLFW.lib
     system : Windows (/SUBSYSTEM:WINDOWS)

*I've already added the necessary include, library files in the tools->options->VC++ directories



Here's the log:
Quote
------ Build started: Project: GLFW_test, Configuration: Release Win32 ------
Compiling...
GLFW_test.cpp
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : error C2146: syntax error : missing ';' before identifier 'glAccum'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C2146: syntax error : missing ';' before identifier 'glAlphaFunc'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1153) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C2146: syntax error : missing ';' before identifier 'GLboolean'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C2146: syntax error : missing ';' before identifier 'glAreTexturesResident'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C2371: 'APIENTRY' : redefinition; different basic types
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1154) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C2146: syntax error : missing ';' before identifier 'glArrayElement'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1155) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C2146: syntax error : missing ';' before identifier 'glBegin'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1156) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C2146: syntax error : missing ';' before identifier 'glBindTexture'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1157) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C2146: syntax error : missing ';' before identifier 'glBitmap'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1158) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C2146: syntax error : missing ';' before identifier 'glBlendFunc'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1159) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C2146: syntax error : missing ';' before identifier 'glCallList'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1160) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C2146: syntax error : missing ';' before identifier 'glCallLists'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1161) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C2146: syntax error : missing ';' before identifier 'glClear'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1162) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C2146: syntax error : missing ';' before identifier 'glClearAccum'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1163) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C2146: syntax error : missing ';' before identifier 'glClearColor'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1164) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C2146: syntax error : missing ';' before identifier 'glClearDepth'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1165) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C2146: syntax error : missing ';' before identifier 'glClearIndex'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1166) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C2146: syntax error : missing ';' before identifier 'glClearStencil'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1167) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C2146: syntax error : missing ';' before identifier 'glClipPlane'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1168) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C2146: syntax error : missing ';' before identifier 'glColor3b'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1169) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C2146: syntax error : missing ';' before identifier 'glColor3bv'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1170) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C2146: syntax error : missing ';' before identifier 'glColor3d'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C2086: 'int APIENTRY' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'APIENTRY'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1171) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : error C2144: syntax error : 'void' should be preceded by ';'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : error C2086: 'int WINGDIAPI' : redefinition
        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1152) : see declaration of 'WINGDIAPI'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : error C2146: syntax error : missing ';' before identifier 'glColor3dv'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : error C2182: 'APIENTRY' : illegal use of type 'void'
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\GL/gl.h(1172) : fatal error C1003: error count exceeds 100; stopping compilation
Build log was saved at "file://c:\programming\Microsoft Visual Studio 9.0\myprojects\GLFW_test\GLFW_test\Release\BuildLog.htm"
GLFW_test - 143 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Thanks!!!!
Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: relsoft on September 28, 2010
Oh, I'm linking the static GLFW.lib.

w/o the including the gl and glu headers I get this:


Quote
1>------ Build started: Project: GLFW_test, Configuration: Debug Win32 ------
1>Compiling...
1>GLFW_test.cpp
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
1>MSVCRTD.lib(MSVCR90D.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LIBCMT.lib(wincrt0.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\programming\Microsoft Visual Studio 9.0\myprojects\GLFW_test\Debug\GLFW_test.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\programming\Microsoft Visual Studio 9.0\myprojects\GLFW_test\GLFW_test\Debug\BuildLog.htm"
1>GLFW_test - 5 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

As a sidenote built a working GLFW+OGL example in codeblocks in like 5 minutes.  However, I would really like to use vc++ express for my windows stuff.

Again, thanks!


Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: Clyde on September 28, 2010
maybe you need to be case sensitive with adding the ogl additional dependencies:

OpenGL32.lib;GLu32.lib
Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: hellfire on September 28, 2010
Hi Rel,

the first set of compile-errors looks like a missing #include <windows.h>.
The link-errors appear because GLFW was compiled with a static runtime and the rest of your project is using the dll-runtime (or vice versa).
To fix the "unresolved _WinMain@16" set linker->subsystem to "console" in the project settings.
If you're using oop you might want to have a look at sfml (http://www.sfml-dev.org), too.
Which version of Visual Studio are you using now?

Quote
maybe you need to be case sensitive with adding the ogl additional dependencies
In Windows filenames are always case-insensitive.
Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: LittleWhite on September 28, 2010
I don't know anything on GLFW
but, if it is the window manager library, you have to put the header before the gl ones ( at least, it's often like this )

After for the libs already including free and other standard functions, maybe you can try, to no include the library coming from Microsoft ... but it doesn't work a lot usually ( it's an option in linking part, saying something about default library ( Yes / No ).
Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: relsoft on September 29, 2010
Thanks for the tips guys, I'll test them in few minutes. 

I got SDL to work(after about 2 hours of nail biting work)! Yay!

Title: Re: GLFW(or SDL)+OPENGL in VS express help....
Post by: LittleWhite on September 29, 2010
Setting the project is often the hardest part of the whole projet :D but once you know it, it should be ok ;)