• Advertisement

Archived

This topic is now archived and is closed to further replies.

stupid externs

This topic is 6025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement