Advertisement

help needed with a couple linking errors....

Started by November 11, 2000 03:09 PM
5 comments, last by Moe 24 years, 1 month ago
The Story: I have truly been programming since about May. Since then I have learned the basics of windows programming, Direct Draw 7, and a touch of Direct3D7IM. My latest project was going great until I did a very stupid thing. I clicked build->build all (VC++6 introductory version). I got 5 strange errors that I had never seen before, and I couldn''t get rid of them. My code was messy, and barely readable, so I thought to myself "This is a mess. I''m going to restart thing thing". I created a new project, cleaned up the old code, and structured it like the recent article here at Gamedev (I believe it was by Ben Dilts). I basically redid everything in my entire project. The problem: Know that I have everything restructured, I am getting about 8 errors I am not sure how to fix. I am pretty sure they have something about how I restructured my program. Here they are: error C2146: syntax error : missing '';'' before identifier ''bitmap_surface'' error C2501: ''LPDIRECTDRAWSURFACE7'' : missing storage-class or type specifiers error C2061: syntax error : identifier ''LPCTSTR'' error C2061: syntax error : identifier ''DWORD'' error C2061: syntax error : identifier ''RECT'' error C2146: syntax error : missing '';'' before identifier ''main_window_handle'' error C2501: ''HWND'' : missing storage-class or type specifiers fatal error C1004: unexpected end of file found My entire project (source, bitmaps, and all) can be downloaded at: www.shrapnelgames.homestead.com Will somebody please download my project and find out what is causing these errors? "Never pet a burning dog." - Warcraft II
Hmm... it doesn''t know any of the basic types.
Sure you #included windows.h and ddraw.h?
Advertisement
I am pretty darn sure. They were also defined in gobals.h and it doesn''t recognize them. Can someone please download my project and see if you can figure it out? (it is a pretty small download of about 350k).

Again, the address to download it is www.shrapnelgames.homestead.com
Oh boy.. you have lots of errors. Your main error was that you weren''t included windows.h, ddraw.h, and d3d.h!!
After including them, i got even more errors!
First of all, in your header file your doing
extern variable = something;

You do NOT define a variable in a header file!!
extern variable;
is all you need!
Define it in the actual cpp file.

Also, you have headers including other headers in your project, and headers including THEMSELVES!!. What is this???!!!!

Hmm.. .and I cant find cube.h anywhere.

You also have a *lot* of functions that are undefined, and quite a few syntax errors.

Geez... now I''m getting the error
d:\countdown\functions.cpp(28) : fatal error C1003: error count exceeds 100; stopping compilation

And why are you #pragma once ing the .cpp files? #pragma once is to prevent multiple header inclusion.

And a lot of your variables are giving me the error redefiniton: multiple initialization, and the other half are givine me undeclared identifier!!!

You''re also calling functions that are members of classes without specifying the variable to call it through.. e.g. Game_State::DD_Init, you''re just calling DD_Init();

I don''t have time to go fix all these errors, but I suggest to you to not just go and code 1500 lines of code then wonder why you get errors. Make sure code is correct before moving on, it will help you identify the errors.

It did work properly before I re-arranged it. It was such a mess that I almost had to re-arrange it. Thanks anyway...
Okay, I solved a lot of those problems you mentioned, Quantum. I still can''t get this entirely cleared up. I really need help. I updated the file so I think I got all the files in the .zip now.

I have been e-mailing Ben Dilts (the guy who wrote the article for Gamedev), but I feel like I am wearing out my welcome with him. I really don''t want him to get mad at me. Can anyone here help me?

"Never pet a burning dog." - Warcraft II
Advertisement
Yeah, I''ll be happy to help if you want to give me a link to the new zip or send it to my email.

This topic is closed to new replies.

Advertisement