Jump to content

  • Log In with Google      Sign In   
  • Create Account

Setting up VC++ 6 for DirectX


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
11 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 30 December 1999 - 02:28 AM

I'm sorry to ask this, I know it's probably been asked a thousand times, and I looked but found no answers. I know there are hundreds of documents that give this information, and I looked but found none that worked for me.

I used to use Borland C++, I liked it, things worked, etc. Well I got Visual C++ 6.0 recently, and I really really really like it. But I can't get directx programs to compile correctly. Here's what I do. I create a new workspace and add all the code. Then I go into Tools->Options, click the directories tab, and set both the Include files and Library files for directx. Next I go into Project->Settings and click on the link tab. I then enter in the names of the proper libraries to the Objects/library modules text box. When I try to compile, however, I get errors like:

error C2146: syntax error : missing ';' before identifier 'ddraw'

error C2501: 'LPDIRECTDRAW4' : missing storage-class or type specifiers

fatal error C1004: unexpected end of file found

Please help me solve this problem.


Sponsor:

#2 frizb   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 December 1999 - 03:23 PM

It sounds like you are missing some {} somewhere. Recheck your typing. Make sure to #include "ddraw.h" also. The unexpected end of file error usually means you missed a } to close a paragraph.

------------------
Still Learning...


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 29 December 1999 - 03:31 PM

Hmm, thanks, but I don't think that's the problem. here's an excerpt from my code.

#include
#include
#include

LPDIRECTDRAW4 ddraw;
DDSURFACEDESC2 ddsd;


#4 BigCarlito   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 December 1999 - 03:51 PM

He's right, sounds like you're missing a }, or a ; after the } at the end of a class. It depends on what you're three #includes are. If one of the includes is a file that you created or a non-system header file, I'd look for it in there. Good luck :-)


#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 29 December 1999 - 03:53 PM

AHHH, i forgot about html on the board. the include right before the LPDIRECTDRAW4 declaration is to for ddraw.h

#6 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 29 December 1999 - 07:02 PM

I am kind of a newbee to but I will try anyways.If it is missing a ';' double click next to error message should take you to line of code.Check the line before it that is where it usually is for me.If not hit help,index and type in error codes that should give you an idea or two.

#7 Zenroth   Members   -  Reputation: 127

Like
Likes
Like

Posted 29 December 1999 - 07:58 PM

Hehe well have fun finding it I know sometimes if i leave out a damm ; or {} somewhere. I'll sometimes get around 300 error msgs(from iostream.h,and so on)the one that makes me mad is when I leave out a ; ,and get msg's like local functions are supported cant build precompiled header......
Gerr!!!!!!!!!!!!!!!!!!

Dont know anyway to fix that but to go look through my code for the error. I wonder if its any better in 5.0 or 6.0(im using 4.2).

[This message has been edited by Zenroth (edited December 30, 1999).]


#8 Erick   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 December 1999 - 08:40 PM

I am getting the exact same error messages

I was told to set the build paths to look at the sdk directories but hoe the f%&@ do you do that, I spent the entire night last night to compile a DirectDraw APP

I have
#include
#include

I get the same errors man, and it is peeing me right off - hehehe

Any solutions to this

------------------
Erick


#9 Erick   Members   -  Reputation: 122

Like
Likes
Like

Posted 29 December 1999 - 08:45 PM

Damn excuse the missing "ddraw.h" and "ddraw.lib"

I think that maybe just maybe you have not set both the include paths and lib paths to your DX sdk

- shot in the dark, give it a bash

I am a VB programmer trying to sus out C++

MISSION -- but I am getting there, but these little niggles are a thorn in my side.

Aaaaarrrgggg
But anyway,
Hope this works

------------------
Erick


#10 matibee   Members   -  Reputation: 204

Like
Likes
Like

Posted 29 December 1999 - 09:49 PM

I think I may know whats going on, because it has taken me ages to figure out how to compile the sample projects that came with the DirectX 6.1 SDK.

It seems you have correctly added the .lib and .h include directories, but you have not moved them to the top of the list!

I just tried compiling my prog with these directories in the default, bottom position and I got 172 errors including those you mentioned!

Regards

Matt


#11 matibee   Members   -  Reputation: 204

Like
Likes
Like

Posted 29 December 1999 - 09:54 PM

I think I may know whats going on, because it has taken me ages to figure out how to compile the sample projects that came with the DirectX 6.1 SDK.

It seems you have correctly added the .lib and .h include directories, but you have not moved them to the top of the list!

I just tried compiling my prog with these directories in the default, bottom position and I got 172 errors including those you mentioned!

Regards

Matt


#12 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 30 December 1999 - 02:28 AM

Hey man, that solved the problems! Thanks alot! BTW, Erick, if you're using MSVC++ then just scroll up to my original message to see how to set the paths.




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