PDA

View Full Version : C++ is Wrecking my Nerves!



Depression Moon
06-12-2009, 06:27 PM
I'm using Visual studio C++2008 Microsoft. I have a problem here. Whenever I try to debufg code I get a window that asks me if I want to build Win32. I click yes it starts compiling and then I get build errors and it asks if I want to run the last successful build. When I try that it says the file cannot be found and symbols are not loaded and if I would like to continue debugging. When I click yes I get a final window saying no DLL specified. What's up here?

Rantz
06-12-2009, 08:14 PM
When it asks you if you want to run the last successful build, it's talking about the last time you built the program without any errors. I'm guessing you haven't built the program successfully yet, which is why it can't find a last successful build. So the core of your problem is in those build errors. What is your code and what errors are you getting?

Depression Moon
06-12-2009, 09:18 PM
This is the code
#include <iostream>
using namespace std;
int main()
{
char x ='a';
char y ='c';
cout << ++x << endl;
cout << y++ << endl;
cout << (x > y) << endl;
cout (x-y) << endl;
system ("pause")
return 0;


And I'm not exactly sure what the errors are since I can't debug the code and find out if there are any. The window that says I have build errors doesn't tell me what they are exaclty and this happens no matter what code I am writing.

Rantz
06-12-2009, 11:25 PM
There should be an output panel that tells you the build errors, but I don't have access to Visual C++ here and I can't remember what it's called. Anyway, there are a few problems (corrected in red) I can spot immediately:

#include &lt;iostream>
using namespace std;
int main()
{
char x ='a';
char y ='c';
cout << ++x << endl;
cout << y++ << endl;
cout << (x > y) << endl;
cout << (x-y) << endl;
system ("pause"); // Dunno what this function is, it may require including another library
return 0;
}

I just started this stuff though, so someone else can probably help you more xD

blackmage_nuke
06-13-2009, 12:02 AM
If your using Visual C++ you go to view in the menu bar at the top, other windows, error list

Then there should be a error list tab down the bottom, in there it has a button (some number) errors, click it and it will show the lines where your errors are and a vague indication to what the error is (some are more vague than others).

Depression Moon
06-13-2009, 01:45 AM
I posted that code wrong i had the iostream and last bracket part. After adding in the missing << and attempting another debug the same thing happens. I am getting no errors from the error list that blackmage nuke pointed out to me.

blackmage_nuke
06-13-2009, 02:39 AM
Are you sure you clicked the button that has a number and then "errors" (if you have no errors it should say "0 errors", if you have some it will say 1 errors or 2 errors)

Copy paste your revised code

Depression Moon
06-13-2009, 02:48 AM
#include <iostream>
using namespace std;
int main()
{
char x ='a';
char y ='c';
cout << ++x << endl;
cout << y++ << endl;
cout << (x > y) << endl;
cout << (x-y) << endl;
system ("pause");
return 0;
}

Yeah 0 errors, warnings, and 0 of this funky i thing in a white circle

Edit: I posted the iostream part, but for some reason it's not showing on this site????????

blackmage_nuke
06-13-2009, 03:35 AM
Hmm thats odd, the code works for me. Is the code in a .cpp file in the Source Files Folder?

Try go to files Save All. Does it ask if you want to Build when you run it?

Try start a new empty project and copy paste your code into a new .cpp file in the source files folder.

NeoTifa
06-13-2009, 03:46 PM
It wont build because you touch yourself at night. Tell ya what. I will help you. See that userbar in my sig? Click it. All your answers and cpp fantasies shall be granted.