Sign in to follow this  

D3DApp error: Base class undefined?

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

Hello, I'm currently reading the book called: "Introduction to 3D Game Programming with DirectX 9.0c A Shader Approach" by Frank D Luna, and I'm on the part in which I am supposed to write text to the screen. However my compiler generates an error when I try to derive from a D3DApp, somehow it isn't being found. My error: error C2504: 'D3DApp' : base class undefined I've included these files: <d3d9.h> <d3dx9.h> "d3d9.lib" (with a #pragma command) What could be doing wrong? Here is my code: //main.cpp #include <d3d9.h> #include <iostream> #include <d3dx9.h> #pragma comment(lib, "d3d9.lib") //This links to the d3d9 library. DO NOT TOUCH. class Hello3DApp : public D3DApp { public: // HelloD3DApp(HINSTANCE hInstance, // std::string WinCaption //incomplete for now. }

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
D3DApp is not a class or structure in DirectX. It's probably a class written by Luna. He may have the source code in the book or, possibly, in the CD if the book comes with one.


Ahhh, thank-you for claifying. It's just that when Luna introduced vectors, they were implemented into the DirectX SDK. I assumed that this was the same.

Share this post


Link to post
Share on other sites
Don't know what IDE you're using, but I assume you've downloaded the DirectX SDK. That comes with documentation, if you haven't taken a look at it (which you really should). If you check in the index for the docs, you'll see no entry for D3DApp.

By the way, it's pretty common for developers to have a reuseable class like that. It normally has functions for initializing DirectX objects, a run loop, etc.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
Don't know what IDE you're using, but I assume you've downloaded the DirectX SDK. That comes with documentation, if you haven't taken a look at it (which you really should). If you check in the index for the docs, you'll see no entry for D3DApp.

By the way, it's pretty common for developers to have a reuseable class like that. It normally has functions for initializing DirectX objects, a run loop, etc.



I am using Microsoft C++ Express Edition as my compiler, if that is what you mean by an IDE. Please pardon me if I sound 'nooby' at all; I'm new to this.

Share this post


Link to post
Share on other sites
Sorry about that. Yeah, IDE is "Integrated Development Environment" (or something very similar). Editor, compiler, linker, debugger, etc., all in one app. And, indeed, that's what MSVS Express is.
Quote:
Please pardon me if I sound 'nooby' at all
No need for pardon. Ya' gotta start somewhere and that's what For Beginners is for.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye

Sorry about that. Yeah, IDE is "Integrated Development Environment" (or something very similar). Editor, compiler, linker, debugger, etc., all in one app. And, indeed, that's what MSVS Express is.
Quote:
Please pardon me if I sound 'nooby' at all
No need for pardon. Ya' gotta start somewhere and that's what For Beginners is for.


You seem like a pretty nice guy. I know of some people who would simply call me stupid or lazy (for not knowing where to search, except Google, that's obvious). Do you know a good way to practice game development after I finish this book? Or do I just leap right in and practice the concepts I've learned?

Share this post


Link to post
Share on other sites
Quote:
do I just leap right in and practice the concepts I've learned?

You haven't already? [wink]

I would recommend that. If you haven't done much programming, you might start out with a console application, just inputting something, doing some calcs and outputting something until you're a bit more comfortable.

When you go from a console app to a windowed app, the learning curve gets pretty steep, pretty fast.

Make use of as many examples as you can. Compile them, run them, change them and understand what your change did. If you don't lock up your machine in the first few weeks, you're not trying hard enough.

When you don't know what something does, look at the docs. And google and this site are excellent resources, also. Note, you can search this site using the search box in the upper right-hand corner and see all the idiots that've already posted what you want to ask. [smile] You won't understand everything at first, but if you never make any mistakes, you'll never learn.

Seriously, most of the folks around here are pretty nice. Don't ever think anything is too noobie to ask.

Learn about debugging early. Actually, practice debugging your first app. Practice at it and see what you can make it tell you. The debug routines are your friend!

Share this post


Link to post
Share on other sites
Quote:
do I just leap right in and practice the concepts I've learned?

You haven't already? [wink]

I would recommend that. If you haven't done much programming, you might start out with a console application, just inputting something, doing some calcs and outputting something until you're a bit more comfortable.

When you go from a console app to a windowed app, the learning curve gets pretty steep, pretty fast.

Make use of as many examples as you can. Compile them, run them, change them and understand what your change did. If you don't lock up your machine in the first few weeks, you're not trying hard enough.

When you don't know what something does, look at the docs. And google and this site are excellent resources, also. Note, you can search this site using the search box in the upper right-hand corner and see all the idiots that've already posted what you want to ask. [smile] You won't understand everything at first, but if you never make any mistakes, you'll never learn.

Seriously, most of the folks around here are pretty nice. Don't ever think anything is too noobie to ask.

Learn about debugging early. Actually, practicing debugging your first app. Practice at it. The debug routines are your friend!

I know a decent portion of basic C++. I'm learning from Sam's Teach Yourself C++ in 21 days (though to me it's taken a little more than that). I'm currently learning about static member variables.

Share this post


Link to post
Share on other sites
Quote:
Original post by Buckeye
Book reading is fine. But programming is a whole lot more fun! Read a few pages and try to code something with it. It won't become real until you see it work. Best of luck!



Hehe, when I get my college work sorted out I will be able to try making a basic CMD RPG. I tried before, but I coded myself into a corner and couldn't read my own code, I neglected to plan ahead.

"If you fail to plan, you plan to fail".

Share this post


Link to post
Share on other sites

This topic is 2856 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this