Advertisement

stupid externs

Started by July 19, 2001 04:02 PM
5 comments, last by Minion 23 years, 7 months ago
Okay, I have this globals structure that houses all of the important game globals. It''s in a file globals.h and it''s section in the header follows
  
#ifndef GLOBALS_OWNERSHIP
extern
#endif

struct {
	HWND      hWnd;
	HINSTANCE hInstance;
	BOOL      bActive;
	BOOL      bQuitting;

	// DirectDraw Globals

	LPDIRECTDRAW7		 lpDD;
	LPDIRECTDRAWSURFACE7 lpDDSPrimary;
	LPDIRECTDRAWSURFACE7 lpDDSBack;
	LPDIRECTDRAWPALETTE  lpDDPal;

	// DirectInput Globals

//	LPDIRECTINPUT7       lpDI;

//	LPDIRECTINPUTDEVICE7 lpDIKeyboard;

//	UCHAR                KeyState[256];

} G;
  
and I get a linker message unresolved external struct __unnamed G Thanks in advance for any help
One of your .c modules must have GLOBALS_OWNERSHIP #defined. If it''s not defined anywhere, than nobody owns your global--it doesn''t exist, therefore the linker says it''s unresolved.
Advertisement
It doesn''t even work if I just directly use

extern struct {
blah
} G;

Also, I used ifndef so I don''t want to define GLOBALS_OWNERSHIP to make the struct extern right?
Okay I have that working now but now it is not createwindowex is not working. For some reason the window is not being made. Also, in another project I''m working on, I get a really weird message:
C:\mssdk\lib\ddraw.lib : fatal error LNK1106: invalid file or disk full: cannot seek to 0x389bc793

any idea what that''s all about
Do you have plenty of disk space for your compiler to use when you compile? If you''ve only something like 100Mb remaining, that might be a problem. Try watching the disk space when you compile.
I have over 6 gigs left on my harddrive.
Advertisement
download the latest service pack or update to vc++ 6

This topic is closed to new replies.

Advertisement