D3DApp error: Base class undefined?
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.
}
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.
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.
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.
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.
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.
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 allNo need for pardon. Ya' gotta start somewhere and that's what For Beginners is for.
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 allNo 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?
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!
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.
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!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement