Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Software Development Software Development
Search Search
Search for:
Tech Support Guy > > >

Solved: C++ 2010 not debugging


(!)

SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
08-Aug-2012, 05:02 PM #1
Solved: C++ 2010 not debugging
When I write a program in c++ and try to debug, I get an error pop-up (see attached photo). I have been using just the simple hello world program to try to figure out why it is happening.

Code:
#include <iostream>
using namespace std;

int main()
{
     cout << "Hello World" << endl;
     system("Pause");
     return 0;
}
And yes, I know that using the system command is bad convention, but I only use it for debugging. My finished products always have the getch() command in place of system("Pause").

If anyone has any ideas on what to do, I would appreciate the help. Thanks in advance.
Attached Thumbnails
Solved: C++ 2010 not debugging-untitled.jpg  
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 04:32 AM #2
Have you verified that the file does actually exist?
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 04:52 PM #3
Yes I have checked and it is not creating that file. I have tried to find wt option would create the files in the options of visual studio and have found nothing. Should I just uninstall and reinstall it or are there any other thoughts. And yes I have the current updates for it, I just updated last night before I posted this and it still did it.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 05:13 PM #4
I'm using VB.net instead of C#, so it may just be different,
For me the executable would be found in
...\HelloWorld\HelloWorld\bin\Debug.

It may be worth checking whether you get that.

Also, a search *.exe wouldn't be amiss.

I'll try to install C# and see if I can figure anything else out.

Edit: I mean C++. Sorry.
Second edit: And it won't install.

Last edited by Ent; 09-Aug-2012 at 05:34 PM..
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 05:38 PM #5
I have all three visual studio express editions; VB, C++, and C#. Hardly use C# right now, but VB works fine. C++ was working fine 3 months ago, and aside from some windows 7 themes, command and conquer tiberian sun, and DX studio (for a project I am working on with friends, a new mmorpg that is done in the style of classic snes games for looks) I haven't installed anything new on my computer in that time.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 05:50 PM #6
3 months! Do you know how many computers a geek can break in that time?

It may seem like a stupid question, but are you actually building the program?
As a VB programmer I'm used to just hitting F5 to compile and run, but if (?) I understand correctly for C++ you have to hit F7 first to build. If nothing else, it may be worth building it without executing it to see whether the problem kicks in there. It would make a lot of sense that it can't find the program because the program isn't there.

Last edited by Ent; 09-Aug-2012 at 05:59 PM..
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 06:00 PM #7
Yes I do realize that 3 months is a long time but I had other priorities than to tinker with c++ in those 3 months, such as a job, job hunting, and the game that we are working on, which is primarily realbasic. I've never had to build the program before, while I was at the tech I just had to hit F5 to compile and run just like in vb.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 06:07 PM #8
OK, C++ is working on my machine now, so I'll have a bit of a tinker and see what I can find.
Apparently it's a fairly common problem.

http://forum.codecall.net/topic/6077...-2010-express/
http://social.msdn.microsoft.com/For...-b7f8d7a060ce/
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 06:11 PM #9
I just noticed that silverlight is no longer on my computer for some reason. Would that have anything to do with it maybe?
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 06:17 PM #10
It could do, but I wouldn't have thought so.
What kind of project is this HelloWorld?

The CLR Console project that the VC++ generates works fine if you just hit F5
Whereas as the empty one gives the exact same error message as you report.

Once I add a .cpp file with your source however, it compiles and works without a problem.

Last edited by Ent; 09-Aug-2012 at 06:24 PM..
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 06:35 PM #11
Also, I notice that there's a "not saved" asterisk by source1.cpp
I wonder whether that may be a significant clue. I thought that the environment automatically saves the file before compilation. Is there something strange about where the source file is located for example?
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 06:46 PM #12
I checked all the options for that not saved asterisk and all that would do anything about it were set to save. What I did was open a new empty project, File, Open, File, and then typed the source. It worked that way all through the time at the tech. And that was the way I was told I am supposed to create a new project.
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 06:51 PM #13
What file did you open?

If you want to create a new project you need the files involved to be part of that project. Better would be to create a new file from within the project.
Right Click on the project (HelloWorld) in the Solution Explorer
Click on ADD then on New Item
Create CPP file.

It should automatically appear under Source files.

Then type your source.
Attached Thumbnails
Solved: C++ 2010 not debugging-c-.jpg  

Last edited by Ent; 09-Aug-2012 at 06:56 PM.. Reason: Adding screenshot
Ent's Avatar
Ent   (Josiah) Ent is offline Ent is a Trusted Advisor with special permissions.
Computer Specs
Trusted Advisor with 5,218 posts.
 
Join Date: Apr 2009
Location: United Kingdom
Experience: Intermediate
09-Aug-2012, 06:58 PM #14
I have to sign off for the night; if that doesn't crack the problem I'll check back in the morning.
SpectresShadow's Avatar
SpectresShadow   (Josh) SpectresShadow is offline
Computer Specs
Member with 121 posts.
THREAD STARTER
 
Join Date: Aug 2012
Location: Waupaca
Experience: Intermediate
09-Aug-2012, 06:59 PM #15
Oops. I meant File, New, File, .cpp file. Sorry.
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑