Coding4Fun game programming Tuts generate 133 errors

Started by
4 comments, last by Fixxer 17 years, 9 months ago
Link To Tutorial I am getting 133 errors. Here are the 1st few, maybe they will let you know whats going on... Error 1 The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) C:\Documents and Settings\Owner\Local Settings\Application Data\Temporary Projects\BattleTank2005\DirectX Support\dxmutmisc.cs 12 17 BattleTank2005 Error 2 The type or namespace name 'DirectX' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) C:\Documents and Settings\Owner\Local Settings\Application Data\Temporary Projects\BattleTank2005\DirectX Support\dxmutmisc.cs 13 17 BattleTank2005 Error 3 The type or namespace name 'Usage' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Owner\Local Settings\Application Data\Temporary Projects\BattleTank2005\DirectX Support\dxmutmisc.cs 514 16 BattleTank2005 Error 4 The type or namespace name 'Format' could not be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Owner\Local Settings\Application Data\Temporary Projects\BattleTank2005\DirectX Support\dxmutmisc.cs 515 16 BattleTank2005
Advertisement
#1. You're probably not including DirectX, or you don't have the proper version of the SDK
#2. Doesn't Microsoft have a forum for their tutorial? You'd think so with the billions of dollars they're raking in.
Well this file with all the errors came with the SDK...
Im totally new to C# too, so im totally confused.
Quote:Original post by Ravuya
#2. Doesn't Microsoft have a forum for their tutorial? You'd think so with the billions of dollars they're raking in.


There's at least a thread about the entire series.
This may be painfully obvious, but I think that you are missing a few assembly references.

Apparently, you are using the downloaded source code. It looks like you probably do not have the DirectX SDK installed. I could be wrong, but it seems that way because when you install the DirectX SDK, the references get added to the GAC (I think that's what it is, not too sure. Stands for Global Assembly Cache) and the source code downloaded off the site already has those references added, but if they're not in the GAC, then you don't have the required references that the project is referencing (still with me?). And you can get them by installing the DirectX SDK. You can get the latest version here: http://msdn.microsoft.com/directx/. It is a rather large file, and gets larger after you install it. It has everything you need to make games, but it's sort of hard to learn from.

I don't think that the file (the source code) you downloaded was the SDK or was included in the SDK. So again, that points to the problem being that you don't have the DirectX SDK.

To add the required references, right-click on your references folder in the Solution Explorer and select "Add Reference...". This is where you can find out if you really have the DirectX SDK. If the needed references are not in the .NET tab, then you don't have the SDK. Otherwise, you're good to go. Or the SDK is out of date. In the list of references, there should be some DirectX ones, namely Microsoft.DirectX, Microsoft.DirectX.Direct3D, Microsoft.DirectX.Direct3DX (there are several versions of this one, just pick the first one), Microsoft.DirectX.DirectInput, and Microsoft.DirectX.DirectSound. There is also a Microsoft.DirectX.DirectDraw, but who uses that any more anyway (jk). You don't need to pay attention to the Microsoft.DirectX 2.0 assembly because it is currently in beta and the tutorial doesn't use that one.

So anyway, if you do that and add all the references you need, you shouldn't get any more errors, or at least, considerably less.

I hope that fixes the errors and helps you out.
No, im new to C#, but im not stupid :)
I have the file, and the SDK.

I use the SDK just fine in my main project cs files.

This topic is closed to new replies.

Advertisement