Jump to content
  • Advertisement
Sign in to follow this  
Slider38

I need a little help

This topic is 4835 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

Hi Folks, I've been working on a program for a while (thousands of lines), and I finally had to replace my computer. I re-installed my VC++ and moved my program to the new box, but now it doesn't run. When I try to compile any of it, I get errors like this - error C2146: syntax error : missing ';' before identifier 'lpdi'. error C2501: 'LPDIRECTINPUT7' : missing storage-class or type specifiers. fatal error C1004: unexpected end of file found. These all occur on the same line. I'm leaving out a bunch of the non-issue stuff, but the program goes into heart failure when it hits the LPDIRECTINPUT7 lpdi = NULL; line. To complicate matters, I'm new to winXP. The new pc came with DirectX 9. I was previously using DirectX 7a. I also installed the DX8sdk. I'm wondering if this problem is due to the version of DirectX on my computer. With WinXP, I don't even know where to find the DX files to see what's in them. At any rate, I thought that DirectX was backwards compatible. Any thoughts on what would be causing these errors would be appreciated. Thanks Slider // INCLUDES /////////////////////////////////////////////// #define WIN32_LEAN_AND_MEAN // just say no to MFC // You need to tell DirectInput if you're using v7.0 or less #define DIRECTINPUT_VERSION 0x0700 #define INITGUID // GLOBALS //////////////////////////////////////////////// HWND main_window_handle = NULL; // globally track main window HINSTANCE hinstance_app = NULL; // globally track hinstance int window_closed = 0; // tracks if window is closed char buffer[80]; // used to print text // directinput globals LPDIRECTINPUT7 lpdi = NULL; // dinput object LPDIRECTINPUTDEVICE7 lpdikey = NULL; // dinput keyboard LPDIRECTINPUTDEVICE7 lpdimouse = NULL; // dinput mouse

Share this post


Link to post
Share on other sites
Advertisement
i jst a noob
and i guessin this
u may have left a bit of data on ur old comp wich could mean u have to rebuild the hole program again or jst the missing line in the syntax
im not sure but i hope it helps
if not post back and ill see what i can find out.

Share this post


Link to post
Share on other sites
I appreciate the thought leonheart. I wish it were that simple, but all the code has been moved over. I guess I'm wondering if I have a DirectX issue. I'm too dumb at this to really know. But having written all this code (again we're talking thousands of lines), I do not wish to go back and try to learn something new (D3D) and re-write it all. I'm wondering if I installed the old DirectX 7a if things would work. The problem is, some of my new programs require DX9, so I'd have to go back and overwrite it, so that wouldn't accomplish much. Surely, there's a way to get this code to work with DX9. Slider

Share this post


Link to post
Share on other sites
Do you have #define DIRECTINPUT_VERSION 0x0700 before your DirectInput headers?

Share this post


Link to post
Share on other sites
I don't see your #includes.

Also, when you installed VC++, did you make sure to update the include/lib directories so that the DX SDK directories are at the top?

Share this post


Link to post
Share on other sites
Hi Dave, I left the includes out to shorten my post, but they're there. I didn't do anything about "update the include/lib directories so that the DX SDK directories are at the top?" How would I do that? Maybe that's my problem. Thanks for the response guys, Slider
P.S. I tried another program that I wrote with similar code and I'm getting the same type of error message.

Share this post


Link to post
Share on other sites
Quote:
Original post by Slider38
I didn't do anything about "update the include/lib directories so that the DX SDK directories are at the top?" How would I do that? Maybe that's my problem.


That is very likely your problem. You don't say what version of VC++, so I can't tell you exactly how to set the directories as it's different with different versions. But, it will be under Tools/Options. With VC++ .NET 2003, you would select Projects and then VC++ Directories. I don't remember the exact sequence in VC++ 6.0.

At any rate, once you find the Directories option, add your DirectX SDK Include directory to the top of the Include Directories list and add your DirectX SDK Lib directory to the top of the Library Directories list.

That should get you going.

Share this post


Link to post
Share on other sites
Hi Dave Hunt, Thanks for the info on the directories. It had been so long since I had set the program up, I had completely forgotten about the directories listed for the includes and the libraries. After getting those fixed, my first test of one of my old programs worked great. Well, almost. My mouse was a bit funky, but I'll get that worked out. Thanks again for the tip. Slider

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!