🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Need help by classes
I would create classes in VC++6.0 Standart and it won''t work
-I have start an new Project (Win32 Application, Name: Win32)
-Selected the "A simple Win32 application"
-I''ve added a new header (opengl.h) and a new source (opengl.cpp)
-I added following text in the header of (opengl.h):
#ifndef OPENGL_H
#define OPENGL_H
#include "StdAfx.h"
class engine{
public:
int x;
int Y;
void SwapType();
};
#endif
-At opengl.cpp i''ve added:
#include "opengl.h"
void engine::SwapType(){
int temp=x;
x=y;
y=temp;
}
-and at the main routine if added this:
ENGINE engine;
engine.x =12;
engine.y =13;
engine.SwapType();
I always get an error.
We can't help unless you tell us what error you get.
Edit: Actually I see one BIG problem, which is that you are creating a Win32 application instead of a Win32 console application.
Edited by - Fruny on November 30, 2001 1:30:36 PM
Edit: Actually I see one BIG problem, which is that you are creating a Win32 application instead of a Win32 console application.
Edited by - Fruny on November 30, 2001 1:30:36 PM
Also, your class name is engine, not ENGINE.
It should be:
engine eng;
eng.x=12;
eng.y=13;
eng.SwapType();
It should be:
engine eng;
eng.x=12;
eng.y=13;
eng.SwapType();
the error i get is in the opengl.cpp at the last line
-fatal error C1010: unexpected end of file while looking for precompiled header directive
-fatal error C1010: unexpected end of file while looking for precompiled header directive
I''m not sure, but you either need to turn precompiled headers OFF(don''t ask me how) or just include stdafx.h in your main cpp file.
quote: Original post by Anonymous Poster
...turn precompiled headers OFF...
Project->Settings->C/C++->[drop-down]Category: Precompiled Headers->[radio]Not Using Precompiled Headers.
Start Here!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement