Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


stupid externs


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Minion   Members   -  Reputation: 118

Like
Likes
Like

Posted 19 July 2001 - 10:02 AM

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

Sponsor:

#2 Stoffel   Members   -  Reputation: 250

Like
Likes
Like

Posted 19 July 2001 - 12:33 PM

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.

#3 Minion   Members   -  Reputation: 118

Like
Likes
Like

Posted 22 July 2001 - 06:52 AM

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?


#4 Minion   Members   -  Reputation: 118

Like
Likes
Like

Posted 22 July 2001 - 07:12 AM

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

#5 Kylotan   Moderators   -  Reputation: 3338

Like
Likes
Like

Posted 22 July 2001 - 07:54 AM

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.

#6 Minion   Members   -  Reputation: 118

Like
Likes
Like

Posted 22 July 2001 - 07:57 AM

I have over 6 gigs left on my harddrive.

#7 earl2499   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 08:02 AM

download the latest service pack or update to vc++ 6




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS