Skip to main content
gamedev.net
🔒 Locked

Linking Errors Galore...

Started by Sfpiano Feb 1, 2003 at 8:16 PM 2 replies 300+ views
Original Post
Sfpiano
Sfpiano
22 Linking errors, all involving redefinations ex: "struct IDirectDrawSurface7 * lpDDSBackground" (?lpDDSBackground@@3PAUIDirectDrawSurface7@@A) already defined in block.obj Yet I look in that file, and don''t see how it could already be defined. http://sfpiano.netfirms.com/tetris.zip
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
RamboBones
RamboBones
I tend to get that problem when I''m not using pre-compiled headers and have to use
#define INITGUID
Could be something to do with that, anyway basically it''s to do with the DirectX header files


OMG. It''s him again. Call the SHRINK!!!
rambo_bones@hotmail.com
WebSite: http://www.illicitdev.net/~rambobones
GlRott Page: http://www.glrott.tk
S1CA
S1CA
My guess is you have a line such as:

LPDIRECTDRAWSURFACE7 lpDDSBackground;

declared in a header (.h) file which means that each source code file (.cpp, .c) which includes that header file declares a new instance of that variable with the same name as another.

Don''t do that in header files.
Put the "LPDIRECTDRAWSURFACE7 lpDDSBackground;" in *ONE* source code (.cpp, .c) file *ONLY*, and then in the header file change the line to:

extern LPDIRECTDRAWSURFACE7 lpDDSBackground;


Ufortunately this is all just a guess because when I go to http://sfpiano.netfirms.com/tetris.zip which I presume is the source code I get a graphic from that server which says "requested file exceeds 256KB". I expect your server has a single file size limit.

Since you just need help fixing this problem rather than extensive testing etc, delete any data from the .zip and don''t zip up anything from the Debug/Release folders or the .NCB or .PCH files, MSVC will recreate those for anyone downloading your project.

--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Sfpiano
Sfpiano
Ok, thanks. I''ll try that stuff. In the meantime, I got the filesize down to 13kb so it should work now. (I had a large bmp for my background so I just changed it to a black picture)
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.