PDA

View Full Version : OpenGL 1.1- GLUT 3.7-CLU Programming on VC++ .NET 2002: fatal error C1083



ScottChang
02-20-2004, 07:58 AM
Hi all,
I used OpenGL1.1/GLUT3.7/CLU(3rd party Library & Utility) to do the Managed C++ .NET 2002 programming on my Windows XP Pro PC. I started from the Empty project (named it 'OGLCLU_Star') and added the files 'OGLWin.cpp', 'StdAfx.cpp', 'Star.cpp','OGLWin.h' and 'StdAfx.h' from the menu "Project". The project 'OGLCLU_Star' with its above-mentioned files and the 3rd party created library and utility are saved in the same sub-directory in my C:\Drive. The source code of OGLCLU_Star is attached below in this post. I did 'Build' on the project 'OGLCLU_Star' and I got the fatal error C1083 three times for not finding the 3rd-party created file 'clu.h'. I know the file 'clu.h' is in the same folder of the project 'OGLCLU_Star'. But I do not know how to set the properties of my project 'OGLCLU_Star' correctively to have 'Include directories' and other settings. Please help and give me some detailed instructions to set 'Include directories' and other settings correctively in the properties of my project 'OGLCLU_Star'.
Thanks in advance,
Scott Chang
===============================
//------OGLWin.cpp-------
> ////////////////////////////////////////////////////////
> // OGLWin.cpp: Implementing the Class COGLWin.
> //////////////////////////////////////////////////////////////////////
>
> #include "StdAfx.h"
> #include "OGLWin.h"
>
> //////////////////////////////////////////////////////////////////////
> // Construction/Destruction
> //////////////////////////////////////////////////////////////////////
>
> COGLWin::COGLWin()
> {
> // Initialize your variables here
> }
>
> COGLWin::~COGLWin()
> {
> // free any allocated memory here
> }
>
> //////////////////////////////////////////////////////////////////////
> /// Init
>
> bool COGLWin::Init()
> {
> // OpenGL rendering context exists at this point.
>
> // Lighting has to be enabled BEFORE
> // you call CGLUTBase::Init() !!!
> EnableLighting();
>
> // Initialize OpenGL settings.
> CCLUDrawBase::Init();
>
> // Can change sensitivity of mouse
> // for rotation...
> SetRotFac(0.5); // default = 1.0
>
> // and for translation
> SetTransFac(0.02); // default = 0.05
>
> // Enable lighting for filter
> m_Filter.EnableLighting();
>
> // Reduce sensitivity
> m_Filter.SetSensitivity(1e-4f);
>
> // Initialize Settings for E3Filter
> m_Filter.Init();
>
> return true;
> }
>
>
> //////////////////////////////////////////////////////////////////////
> /// Display
>
> void COGLWin: http://www.opengl.org/discussion_boards/ubb/biggrin.gifisplay()
> {
> // Always call this function before drawing
> BeginDraw();
>
> // Draw coordinate axes (optional)
> DrawBase();
> // Draw Frame Box (optional)
> DrawBox(3.0);
>
> // Draw you own stuff
> Draw();
>
> // Always call this function after drawing
> EndDraw();
> }
>
>
> //////////////////////////////////////////////////////////////////////
> /// Draw
> void COGLWin: http://www.opengl.org/discussion_boards/ubb/biggrin.gifraw()
> {
>
> // Euclidean space
>
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
> // Clear Screen And Depth Buffer
> glLoadIdentity();
> // Reset The Current Modelview Matrix
> glTranslatef(-1.5f,0.0f,-6.0f);
> // Move Left 1.5 Units And Into The Screen 6.0
> glBegin(GL_LINE_LOOP);
> // Drawing a star by using 10 vertices for the outer rims of a star

> glVertex3f (0, 0.5, 0); //Specify the next 10 vertices
> glVertex3f (-0.2, 0.2, 0); //Specify the next 10 vertices
> glVertex3f (-0.5, 0.1, 0);
> glVertex3f (-0.2, -0.1, 0);
> glVertex3f (-0.3, -0.5, 0);
> glVertex3f (0, -0.2, 0);
> glVertex3f (0.3, -0.5, 0);
> glVertex3f (0.2, -0.1, 0);
> glVertex3f (0.5, 0.1, 0);
> glVertex3f (0.2, 0.2, 0);
> glVertex3f (0, 0.5, 0);
> glEnd(); // Finished drawing the star shape
> glColor3f (0.0, 1.0, 0.0); //Set the color to green
> glBegin(GL_LINES); //Draw 10 lines radiating from (0,0,0) to each
vertex
>
>
> glVertex3f (0, 0.5, 0); //1st vertix to connect the origin to form a
> line
>
> glVertex3f (0, 0, 0);
> glVertex3f (-0.2, 0.2, 0); //2nd vertex
> glVertex3f (0, 0, 0);
> glVertex3f (-0.5, 0.1, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (-0.2, -0.1, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (-0.3, -0.5, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (0, -0.2, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (0.3, -0.5, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (0.2, -0.1, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (0.5, 0.1, 0);
> glVertex3f (0, 0, 0);
> glVertex3f (0.2, 0.2, 0);
> glVertex3f (0, 0, 0);
> glColor3f (0.5, 0.5, 1.0); //Set the color to blue
> glVertex3f (0, 0.5, 0);// last vertex
> glVertex3f (0, 0, 0);
> glEnd(); // Finished drawing the last line
>
> glColor3f (1.0, 0.0, 0.0); //Set the color to red
> glBegin(GL_TRIANGLES);
> glVertex3f (0, 0, 0);
> glVertex3f (0.5, 0.1, 0);
> glVertex3f (0.2, 0.2, 0);
> glEnd();
>
> }
>
>
> //----StdAfx.cpp----
>
> #if
!defined(AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC 48075EC48__INCLUDED_)
> #define AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC48075EC48 __INCLUDED_
>
> #if _MSC_VER > 1000
> #pragma once
> #endif // _MSC_VER > 1000
>
>
> #define CLUDRAW_GLUT
>
> #include "clu/clu.h"
> #include "clu/cludraw.h"
> #include "clu/OGLWinGLUT.h"
>
>
> //{{AFX_INSERT_LOCATION}}
> // Microsoft Visual C++ fügt zusätzliche Deklarationen unmittelbar vor der

> vorherigen Zeile ein.
>
> #endif // !defined
> (AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC48075EC4 8__INCLUDED_)
>
> //------Star.cpp-----
> #include "StdAfx.h"
> #include "OGLWin.h"
>
> int main(int argc, char* argv[])
> {
> COGLWin oglWin;
>
> printf("\nMove the two points by selecting them\n");
> printf("with buttons 1 and 2.\n");
> printf("Change the rotor by selecting it with button 3,\n");
> printf("and then using the left mouse button.\n\n");
> printf("Press 'q' to end the program.\n\n");
>
> oglWin.Create(&argc, argv, "CLUDraw Star");
> oglWin.Run();
>
> return 0;
> }
>
> //------OGLWin.h------
> #if
!defined(AFX_OGLWIN_H__948387CF_09B2_4CBB_B6D2_2A1 473F061B2__INCLUDED_)
> #define AFX_OGLWIN_H__948387CF_09B2_4CBB_B6D2_2A1473F061B2 __INCLUDED_
>
> #if _MSC_VER > 1000
> #pragma once
> #endif // _MSC_VER > 1000
>
> class COGLWin : public COGLWinGLUT
> {
> public:
> COGLWin();
> virtual ~COGLWin();
>
> bool Init();
>
> protected:
> void Display();
> void Draw();
>
> E3GA<float> m_E3Base;
> PGA<float> m_P3Base;
> ConfGA<float> m_N3Base;
> COGLMVFilter m_Filter;
> };
>
> #endif // !defined
> (AFX_OGLWIN_H__948387CF_09B2_4CBB_B6D2_2A1473F061B 2__INCLUDED_)
>
> //------StdAfx.h-----
>
> #if
!defined(AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC 48075EC48__INCLUDED_)
> #define AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC48075EC48 __INCLUDED_
>
> #if _MSC_VER > 1000
> #pragma once
> #endif // _MSC_VER > 1000
>
>
> #define CLUDRAW_GLUT
> #include "clu/clu.h"
> #include "clu/cludraw.h"
> #include "clu/OGLWinGLUT.h"
>
>
> //{{AFX_INSERT_LOCATION}}
> // Microsoft Visual C++ fügt zusätzliche Deklarationen unmittelbar vor der

> vorherigen Zeile ein.
>
> #endif // !defined
> (AFX_STDAFX_H__5832C67E_8108_43C4_A445_0CC48075EC4 8__INCLUDED_)