Post your code.
It tells you you're missing '{' somewhere.
okay.... when i build my project this is my error code
okay anyone know how to get make the errors go away?Code:1>------ Build started: Project: Basics, Configuration: Debug Win32 ------ 1> Basics.cpp 1>c:\users\owner\documents\visual studio 2010\projects\basics\basics\basics.cpp(9): error C2447: '{' : missing function header (old-style formal list?) 1>c:\users\owner\documents\visual studio 2010\projects\basics\basics\basics.cpp(24): fatal error C1004: unexpected end-of-file found ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
idkk if i should put the code in here cause theres some noobs that will copy and paste :X
but if its necessary just tell me and i will
Post your code.
It tells you you're missing '{' somewhere.
B1ackAnge1 (01-08-2010)
Code:#include <windows.h> #include <stdio.h> #include <cstdio> #include <fstream> #include <d3d9.h> #include <d3dx9.h> { D3DCOLOR xcolor = D3DCOLOR_ARGB( 255, 0, 0, 255 ); int size = 13, strong = 1; int iCenterX = GetSystemMetrics( 0 ) / 2; int iCenterY = GetSystemMetrics( 1 ) / 2; if( iCenterX < 20 && iCenterY < 20 ) { iCenterX = ( GetSystemMetrics( 0 ) / 2 ); iCenterY = ( GetSystemMetrics( 1 ) / 2 ); } D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong}; D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size}; pDevice->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0, 0); pDevice->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0, 0); }
noobs will copy paste? You're a copy paster urself if you're too retarded to find the missing { o__O
Ah we-a blaze the fyah, make it bun dem!
B1ackAnge1 (01-08-2010)
Not trying to be mean or anything but...Let's just put it this way: if you supposedly wrote that yourself as you claim you did, you should know where your problem is since anyone reading chapter 1 of C++ for dummies would be able to tell you where the obvious issue is...
If you can't see the problem with the code you posted I sincerely recommend you get a C++ book/tutorial something and start at the BEGINNING
*shakes head and walks away* what is this world coming to....
I'll give you a hint though.. ever heard of functions? methods?
Last edited by B1ackAnge1; 01-08-2010 at 04:16 PM.
Looks like you're trying to make an XHair?
Download the Tatnium D3D Starterkit and put this in EndScene then try it.
Code:bool TestXHair = false; if( TestXHair ) { D3DCOLOR xcolor = D3DCOLOR_ARGB( 255, 0, 0, 255 ); int size = 13, strong = 1; int iCenterX = GetSystemMetrics( 0 ) / 2; int iCenterY = GetSystemMetrics( 1 ) / 2; if( iCenterX < 20 && iCenterY < 20 ) { iCenterX = ( GetSystemMetrics( 0 ) / 2 ); iCenterY = ( GetSystemMetrics( 1 ) / 2 ); } D3DRECT rec2 = { iCenterX- size, iCenterY, iCenterX+ size, iCenterY+ strong}; D3DRECT rec3 = { iCenterX, iCenterY- size, iCenterX+ strong,iCenterY+ size}; m_pD3Ddev->Clear(1, &rec2, D3DCLEAR_TARGET, xcolor, 0, 0); m_pD3Ddev->Clear(1, &rec3, D3DCLEAR_TARGET, xcolor, 0, 0); } if( GetAsyncKeyState( VK_NUMPAD1 ) &1 ) { TestXHair = !TestXHair; }
You didn't declare pDevice and you need a main function, unless it's a DLL... I think.
B1ackAnge1 (01-08-2010)
I appreciate you trying to learn - really I do, however:
most people when trying to learn something new start with the basics and don't just jump into something they 'want' or find interesting.. if you start to learn how to play guitar or piano, you're not going to be playing Steve Vai, or Mozart right away, you start with stupid simple stuff. Same with programming - you start with the basic concepts, you don't just jump into Hacking, D3D etc.
If you don't even know that you need to have functions (or even a main function like david above me mentioned) to put your code in, let alone how to write one from scratch I AGAIN highly suggest you take a break from whatever project you're wanting to work on, and start with Hello world, adding 2 numbers, or other SIMPLER programs until you can do those in your sleep. Then once you understand the concepts of how a C++ program is even supposed to be structured you can move on to the more 'fun' projects..
Otherwise what's gonna end up happening is the only way your project would be 'fixed' is where 'we' write everything for you, you copy & paste it, hit compile and go off saying 'you' wrote something while really you didn't etc etc and if you have read some of the other threads, we really frown upon that type of behavior. And i could tell you: Put this here and that there, but what does that do for you? Nothing since you'll have no idea WHY you had to make the change.
On the flipside, we always encourage and help out people who are truly trying to learn how to program C++ / C / ASM etc who have intelligent questions.
Anyway, Not even knowing what a (main) function is and why it's required, which is usually explained on page 1 or 2 of any C++ book/tuturial unfortunately comes across as someone who does NOT want to learn, but wants to leech. If that's not the case, then make the effort to learn things properly
Again - not trying to be a dick - but that's how it is.
Last edited by B1ackAnge1; 01-08-2010 at 04:51 PM.
/ac1d_buRn (01-09-2010),Lolland (01-09-2010),Void (01-08-2010),zeco (01-08-2010)
If you try "Hello World" and it doesn't work, it means you don't actually know what you're doing.
[php]
#include <iostream>
int main()
{
std::cout << "Hello World!";
cin.get();
}
[/php]