#### Archived

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

# Problems with VC++ 6.0 w/ DirectX

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

## Recommended Posts

Hi, I have been using VC++ 5.0 for a while now, and havent had any problems, but i just upgraded to VC++ 6.0, and now i have problems compiling, but I get this error with DirectX and I dont understand why it is. Here is my code that is giving the errors: extern LPDIRECTDRAW7 lpDD; extern LPDIRECTDRAWSURFACE7 lpDDSPrimary; extern LPDIRECTDRAWSURFACE7 lpDDSBack; These lines are inside my global variables header, and they have worked perfectly before under 5.0, but then when I now compile with 6.0, I get this error: c:\programming\directx\tbs\globalvariables.h(95) : error C2146: syntax error : missing '';'' before identifier ''lpDD'' c:\programming\directx\tbs\globalvariables.h(95) : fatal error C1004: unexpected end of file found if I comment out the line, then i get the same error for the next line, and it will do it for any of my directX lines like that, but why in the heck does it want a '';'' before my lpDD? The semi colon is supposed to come after!! Can anyone help me with this please? Possibility

##### Share on other sites
Oh I am stupid, I figured it out 10 seconds after writing that. I forgot to put the loctions of my directx libraries and headers into the dev studio. lol
It works now

Possibility

##### Share on other sites
shit, now I am getting upset. I get it to compile, but when I run it, the game starts up and pops onto the screen for only half a second, and then cuts out.

So I go and load up VC++ 5.0, and recompile and it runs perfectly, so I look baffled and go back to vc++ 6.0, and recompile it in that and then it doesnt work again, the game exits to windows after half a second. I can see it that breif moment, but it crashes right away. I dont understand it. How can this be? Isnt 6.0 supposed to be better then 5.0?

Possibility

##### Share on other sites
To avoid problems with your header files, you should always do the following:
// something.h#ifndef _SOMETHING_H_INCLUDED_#define _SOMETHING_H_INCLUDED_// Your stuff#endif

Excuse me, if you''re already doing

If you don''t get any error messages, when your program crashes, this might be the reason:

int Something[10];//...Something[13] = x;   //Program crashes without any error msg.

Hope this helped

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 9
• 12
• 20
• 12
• 13
• ### Forum Statistics

• Total Topics
632147
• Total Posts
3004445

×