C:1083

Started by
5 comments, last by google_me 14 years, 1 month ago
Hello guys, I am learning OpenGL thru a book.It has a source code which works fine as it is. Recently i copied and pasted the same code to another new project, which is not working(I just wanted to mention that i have also written the same code myself, which is also not working with 9 errors :( ) I checked the path. Path has" /include" so it is right. This is the error- fatal error C1083: Cannot open include file: 'CGfxOpenGL.h': No such file or directory I created project "VC++ -> CLR application" is it the right way to do it? Its a "beginning opengl game programming" book.2nd chapter program "simple"
Advertisement
Start with a Win32 (non-console) project.

In the project configuration:

Add to "Additional Include Directories" the directory for your headers.
Add to "Additional Library Directories" the directory for your opengl lib file.
Add to "Additional (linker) Dependencies" your opengl lib file.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

I think i solved that header file error

but now i m getting these errors -
[SOURCE]1>------ Build started: Project: trial, Configuration: Debug Win32 ------1>Linking...1>trial.obj : error LNK2019: unresolved external symbol "public: void __thiscall CGfxOpenGL::SetupProjection(int,int)" (?SetupProjection@CGfxOpenGL@@QAEXHH@Z) referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)1>trial.obj : error LNK2019: unresolved external symbol __imp__wglDeleteContext@4 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)1>trial.obj : error LNK2019: unresolved external symbol __imp__wglMakeCurrent@8 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)1>trial.obj : error LNK2019: unresolved external symbol __imp__wglCreateContext@4 referenced in function "long __stdcall MainWindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainWindowProc@@YGJPAUHWND__@@IIJ@Z)1>trial.obj : error LNK2019: unresolved external symbol "public: void __thiscall CGfxOpenGL::Render(void)" (?Render@CGfxOpenGL@@QAEXXZ) referenced in function _WinMain@161>trial.obj : error LNK2019: unresolved external symbol "public: void __thiscall CGfxOpenGL::Prepare(float)" (?Prepare@CGfxOpenGL@@QAEXM@Z) referenced in function _WinMain@161>trial.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CGfxOpenGL::Init(void)" (?Init@CGfxOpenGL@@QAE_NXZ) referenced in function _WinMain@161>trial.obj : error LNK2019: unresolved external symbol "public: __thiscall CGfxOpenGL::CGfxOpenGL(void)" (??0CGfxOpenGL@@QAE@XZ) referenced in function _WinMain@161>C:\Users\hii\Documents\Visual Studio 2008\Projects\trial\Debug\trial.exe : fatal error LNK1120: 8 unresolved externals1>Build log was saved at "file://c:\Users\hii\Documents\Visual Studio 2008\Projects\trial\trial\Debug\BuildLog.htm"1>trial - 9 error(s), 0 warning(s)[/SOURCE]



[Edited by - google_me on February 23, 2010 12:43:53 PM]
Are you including a file with the implementation of CGfxOpenGL in your project?

It might be named CGfxOpenGL.cpp or similar.
ya, Project consist of CGfxOpenGL.cpp, trial.cpp, CGfxOpenGL.h.
Are you sure that the file is included in your project? It's not enough for it to just be sitting in the same directory as your other files - it must included in the project file listing, so it gets compiled and linked in. It doesn't currently seem like this is the case.

In MSVS, you generally do this by right-clicking the solution explorer pane, and choosing "Add > Existing Item".

If you're sure you've added the file, can you post the BuildLog.htm file referred to in your build messages? Use [source]..[/source] tags to keep it tidy.
I was also wondering the same thing, y the files are not being listed in the project.
Now this time i added new item(class), but i m getting error that i fail to understand. :(

Build Log      Build started: Project: 1st program, Configuration: Debug|Win32 Command Lines      Creating temporary file "c:\Users\hii\Documents\Visual Studio 2008\Projects\1st program\1st program\Debug\RSP00001153685964.rsp" with contents[/Od /I "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Yu"stdafx.h" /Fp"Debug\1st program.pch" /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /c /ZI /TP ".\CGfxOpenGL.cpp"".\1st program.cpp"]Creating command line "cl.exe @"c:\Users\hii\Documents\Visual Studio 2008\Projects\1st program\1st program\Debug\RSP00001153685964.rsp" /nologo /errorReport:prompt" Output Window      Compiling...1st program.cppc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\1st program.cpp(5) : warning C4627: '#include ': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\1st program.cpp(6) : warning C4627: '#include ': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\1st program.cpp(8) : warning C4627: '#include "CGfxOpenGL.h"': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\1st program.cpp(258) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?CGfxOpenGL.cppc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(4) : warning C4627: '#include ': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(5) : warning C4627: '#include ': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(6) : warning C4627: '#include ': skipped when looking for precompiled header use        Add directive to 'stdafx.h' or rebuild precompiled headerc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(24) : error C3861: 'glClearColor': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(43) : error C3861: 'glViewport': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(44) : error C2065: 'GL_PROJECTION' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(44) : error C3861: 'glMatrixMode': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(45) : error C3861: 'glLoadIdentity': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(48) : error C2065: 'GLfloat' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(48) : error C2146: syntax error : missing ')' before identifier 'width'c:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(48) : error C2059: syntax error : ')'c:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(50) : error C2065: 'GL_MODELVIEW' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(48) : error C3861: 'gluPerspective': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(50) : error C3861: 'glMatrixMode': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(51) : error C3861: 'glLoadIdentity': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(65) : error C2065: 'GL_COLOR_BUFFER_BIT' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(65) : error C2065: 'GL_DEPTH_BUFFER_BIT' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(65) : error C3861: 'glClear': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(66) : error C3861: 'glLoadIdentity': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(69) : error C3861: 'glTranslatef': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(70) : error C3861: 'glRotatef': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(71) : error C3861: 'glRotatef': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(72) : error C3861: 'glRotatef': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(75) : error C3861: 'glColor3f': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(78) : error C2065: 'GL_TRIANGLES' : undeclared identifierc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(78) : error C3861: 'glBegin': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(79) : error C3861: 'glVertex3f': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(80) : error C3861: 'glVertex3f': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(81) : error C3861: 'glVertex3f': identifier not foundc:\users\hii\documents\visual studio 2008\projects\1st program\1st program\cgfxopengl.cpp(82) : error C3861: 'glEnd': identifier not foundGenerating Code... Results      Build log was saved at "file://c:\Users\hii\Documents\Visual Studio 2008\Projects\1st program\1st program\Debug\BuildLog.htm"1st program - 28 error(s), 6 warning(s)  

This topic is closed to new replies.

Advertisement