-
July 22nd, 2010, 03:17 PM
#1
Problem with extern
Here is my main.h
Code:
#ifndef main_h
#define main_h
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <mmsystem.h>
#include <string>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#pragma comment(lib, "Winmm.lib")
#define SCREEN_WIDTH 1440
#define SCREEN_HEIGHT 900
#define WNDCLASSNAME L"PoweredByShezzy"
#include "CApp.h"
#include "CCamera.h"
extern CApplication g_Application;
LRESULT CALLBACK WindowEventProc(HWND,UINT,WPARAM,LPARAM);
#endif
When I have added the "extern CApplication g_Application;" line I am getting errors:
Code:
1> cApp.cpp
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C2146: syntax error : missing ';' before identifier 'g_Application'
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1> cCamera.cpp
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C2146: syntax error : missing ';' before identifier 'g_Application'
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\tomek\projects\dxtest\dxtest\main.h(24): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
What could be the problem?
-
July 22nd, 2010, 03:36 PM
#2
Re: Problem with extern
Did you include the header that defines CApplication?
Viggy
-
July 22nd, 2010, 03:50 PM
#3
Re: Problem with extern
Yes it is: #include "CApp.h".
BTW. Thats my first day with class programming.
-
July 22nd, 2010, 03:59 PM
#4
Re: Problem with extern
Remember, C++ is case sensitive. In a previous post, you called the class 'cApplication'.
Viggy
-
July 22nd, 2010, 04:30 PM
#5
Re: Problem with extern
Yeah it was the problem.
Thank you.
I have standarized all my variables so I hope I am not gonna lose again.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|