c++ - glu.h PROBLEMS! -


ok im setting visual studios c++ 10 on windows 7 can run sample progams book "opengl superbible 5th edition" i'm having major issues, in getting gltools , freeglut wok:
here's how set far.........................

fist followed these steps got online:

first youl want download glut or freeglut, unzip ofc.
- got zip file @ http://www.starstonesoftware.com/opengl/

in freeglut folder there should folder called visualstudio2008, go this.

there should vs project file called freeglut, run , click finish if conversion window comes up. compile it, if when done says unable start, ok.

now in same folder there should new folder called debug, have compiled freeglut :).

inside find freeglut.dll. needs go system32 folder, or syswow64 respectivily.

aswell there file called freeglut, type object file library. needs go lib folder in visual studio.

now go main freeglut folder. there should folder called include. , inside folder called gl , 2 files. these need copied include folder in visual studio.

the lib , include folders inside vc folder in main visual studio folder me microsoft visual studio 10.0 .

there :).`

then followed these steps set gltools , freeglut:

this requires admin permission on computer.

i. copy of freeglut header files (ending in .h) folder: c:\program files\microsoft visual studio 10.0\vc\include\gl\

ii. copy of gltools header files (ending in .h) c:\program files\microsoft visual studio 10.0\vc\include\

iii. copy of freeglut , gltools library files (ending in .lib) files c:\program files\microsoft visual studio 10.0\vc\lib\

iv. though have copied gltools.lib lib folder, may still need tell vs2010 use gltools.lib file when compiling projects. open property manager (you'll need open project this), menu option view → property manager. left hand pane of vs ide change show property manager. can resize make more readable. expand project if full listing not shown, double click on 1 of microsoft.cpp.win32.user links open user properties dialog. in property manager, select linker → input, click on additional dependencies (see below). in dialog pops add “gltools.lib”, added feeglut_static.lib this!

alright here's code i'm tying run:

#include <gltools.h>            // opengl toolkit  #include <glshadermanager.h>    // shader manager class   #ifdef __apple__  #include <glut/glut.h>          // os x version of glut  #else  #define freeglut_static  #include <gl/glut.h>            // windows freeglut equivalent  #endif    glbatch trianglebatch; glshadermanager shadermanager;  /////////////////////////////////////////////////////////////////////////////// // window has changed size, or has been created. in either case, need // use window dimensions set viewport , projection matrix. void changesize(int w, int h)     {     glviewport(0, 0, w, h);     }   /////////////////////////////////////////////////////////////////////////////// // function needed initialization on rendering context. // first opportunity opengl related tasks. void setuprc()     {     // blue background     glclearcolor(0.0f, 0.0f, 1.0f, 1.0f );      shadermanager.initializestockshaders();      // load triangle     glfloat vverts[] = { -0.5f, 0.0f, 0.0f,                           0.5f, 0.0f, 0.0f,                           0.0f, 0.5f, 0.0f };      trianglebatch.begin(gl_triangles, 3);     trianglebatch.copyvertexdata3f(vverts);     trianglebatch.end();     }    /////////////////////////////////////////////////////////////////////////////// // called draw scene void renderscene(void)     {     // clear window current clearing color     glclear(gl_color_buffer_bit | gl_depth_buffer_bit | gl_stencil_buffer_bit);      glfloat vred[] = { 1.0f, 0.0f, 0.0f, 1.0f };     shadermanager.usestockshader(glt_shader_identity, vred);     trianglebatch.draw();      // perform buffer swap display buffer     glutswapbuffers();     }   /////////////////////////////////////////////////////////////////////////////// // main entry point glut based programs int main(int argc, char* argv[])     {     gltsetworkingdirectory(argv[0]);      glutinit(&argc, argv);     glutinitdisplaymode(glut_double | glut_rgba | glut_depth | glut_stencil);     glutinitwindowsize(800, 600);     glutcreatewindow("triangle");     glutreshapefunc(changesize);     glutdisplayfunc(renderscene);      glenum err = glewinit();     if (glew_ok != err) {         fprintf(stderr, "glew error: %s\n", glewgeterrorstring(err));         return 1;         }      setuprc();      glutmainloop();     return 0;     } 

and finally, here's errors im recieveing:

1>------ build started: project: triangle, configuration: debug win32 ------ 1>  triangle.cpp 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(225): error c2144: syntax error : 'void' should preceded ';' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(225): error c4430: missing type specifier - int assumed. note: c++ not support default-int 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(226): error c2144: syntax error : 'void' should preceded ';' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(226): error c4430: missing type specifier - int assumed. note: c++ not support default-int 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(226): error c2086: 'int glapi' : redefinition 1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(225) : see declaration of 'glapi' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(227): error c2144: syntax error : 'void' should preceded ';' 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(227): error c4430: missing type specifier - int assumed. note: c++ not support default-int 1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(227): error c2086: 'int glapi' : redefinition 1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\gl\glu.h(225) : see declaration of 'glapi' 

error c1003: error count exceeds 100; stopping compilation

this goes on forever , don't know how there can such problem, , why it's happening in glu.h! i'm reallly not sure whats wrong i've had problem week... please =)

thank you, , feel free ask questions!

unfortunately of instructions followed bad ideas. copying debug dlls system directory -- bad. copying files visual studio include directory -- bad.

i don't use glut don't have sequence of working steps, should have made subdirectory in project include, lib, , bin subdirectories, , arranged inside there. while visual c++ 2008 had machine-wide directory settings, visual c++ 2010 has per-project directory configuration.

as far fixing error have now, need show block of gl/glu.h starting @ line 225.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -