Problems running the Debug in C++

closed account (zvMoizwU)
Hello Everyone!

I'd appreciate any help anyone can give me in this very frustrating problem I'm having in using the debugger in Visual Studio Express Edition 2008. I create a project and add a .cpp file and write my little program and place my breakpoint. However, every time I go to debug my program i get an error stating that:

"Unable to start program: C:/Users/TheDevilsWaffle/Visual Studio 2008/Homework1/Debug/Homework1.exe

The system can not find the file specified."

In order to help eliminate my computer as part of the problem, i installed Visual Studio Express Edition 2008 on my laptop and i still get the same error. It's worth noting that I'm using Vista Ultimate x64 on both computers, but I'm having a hard time believing that that's the real issue. I've tried completely uninstalling/reinstalling and also repairing, and still no help.

So yeah, no console opening up when i run the debugger and that error message. Anyone have any ideas?

Oh! and it's worth noting that when i trace the file on my computer to it's location it seems to be making a redundant folder:

C:/Users/TheDevilsWaffle/Visual Studio 2008/Homework1/Homework1/Debug/Homework1.exe

When i try to merge the folders together it seems that Visual Studio doesn't like the change.

Thanks for the help!
Last edited on
Actually, it's very likely that the problem is the CPU word.
Is your target machine X86 or X64?
Last edited on
closed account (zvMoizwU)
hopefully i'm understanding you correctly when you are asking me if my target machine is x86 or x64...

The computers that i am using are using Vista Ultimate x64. It's probably worth noting that when i go to create a project i'm using the Windows Console 32 option, but shouldn't that work fine even in my x64 environment? I mean there's a lot of programs that i can run that are x86 based on a x64 machine...
I have to plead ignorance on this matter, but why don't we rule this as soon as possible?
Go to Project Properties->Linker->Advanced->Target Machine and set it to X64.
closed account (zvMoizwU)
Thank you for all your help thus far...

I went ahead to the Project Properties > Linker > Advanced > Target Machine >

from there it was set to Machine X86 so i went ahead and scrolled down to change it to Machine X64.

Just to make sure it's not my original project that was causing the problem i went ahead and made a new project "Machine64Test" and i noticed that my options are to make a "WindowsConsole32" project. I selected this (because there really is no other option, right?) and then chose to make an empty project.

Next i went into Machine64Test's project properties and set the Target Machine to X64. Added a new .cpp file named "Test" and here's what i get the original error message.

The only other thing that i might mention is that when i created the .cpp file it once again saved it in:

C:/Users/TheDevilsWaffle/Visual Studio 2008/Projects/Machine64Test/Machine64Test/

Again, it seems that the directory to this file is redundent. I tried eliminating the last "Machine64Test" and it still doesn't work.

Thank you again for all your help! I'll check in constantly to see if anyone has found a solution, and i'll let you know if i find anything on my own!
No, it's not redundant. The first one is the solution directory, and the second is the project directory.

The only other thing that I can think of is that there's some step missing.
Would you mind describing every step you perform from the moment you hit ctrl+shift+N to the moment you start debugging? You can also upload screenshots if you prefer.
closed account (zvMoizwU)
Okay so once again i find myself tracing this directory in hopes of finding what the problem is:

unable to find:
C:/Users/TheDevilsWaffle/Visual Studio 2008/Projects/Machine64Test/Debug/Machine64Test.exe

As it turns out the missing Machine64Test.exe is actually located in this directory:

C:/Users/TheDevilsWaffle/Visual Studio 2008/Projects/Machine64Test/Machine64Test/Debug/Machine64Test.exe

So i went ahead and copied everything in the Debug directory to the earlier Machine64Test directory so it would line up where the error says it is looking for Machine64Test.exe and i still get the same error claiming that the file just isn't there!

Despite my frustration, i decided to take a good look at this Test.exe and the properties state this:

name: Machine64Test2.exe.embed.manifest
file type: MANIFEST file .manifest
Opens with: Windows Shell Common

Is this right?

Shouldn't it be just a simple .exe Executable file?

No, that's not the directory. That directory is used as... Well, I don't really know what it's for, but no binaries are stored there by default.
The file should be in C:/Users/TheDevilsWaffle/Visual Studio 2008/Projects/Machine64Test/Debug/Machine64Test2.exe
Last edited on
closed account (zvMoizwU)
Okay Step-by-Step, here we go:

Crtl+Shift+N

Win32->Win32 Application

Name:NewTest
Save Location: C:/Users/TheDevilsWaffle/Documents/Visual Studio 2008/Projects

::pop up window::

I check these 3 options: Console Application, Empty Project, Precomplied Header

then i click finish.

right click on NewTest->Add->New Item->.cpp file

Name:TheTest
Save Location: C:/Users/TheDevilsWaffle/Documents/Visual Studio 2008/Projects/NewTest/NewTest/

:::Step i have added since talking to you:::
Project Properties->Configuration->Linker->Advanced->Target Machine->MachineX64

i click apply, then okay.

This is the program that i'm using to test (don't make fun! it probably has errors and i'm brand new!)

___________________________________________________________

// This is Program A & B for Homework 1
// Created by Travis Moore for CSCI-40 on September 18th, 2008

#include <iostream> // include the iostream library
using std::cout;
using std::cin;
using std::endl;

int main() // start function main
{
int ph1, ph2, ph3, ph4, ph5, ph6, ph7, ph8, ph9, ph10; // declare ph1-ph10 to store digits that user inputs
cout << "Welcome to Homework 1 Program A/n Please enter ten digits:" << endl; // display welcome message
cin >> ph1, ph2, ph3, ph4, ph5, ph6, ph7, ph8, ph9, ph10; // store digits to ph1-ph10
// display user provided digits in phone number format
cout << "(" << ph1, ph2, ph3 << ")" << ph4, ph5, ph6 << "-" << ph7, ph8, ph9, ph10 << endl;
// display user provided digits with spaces inbetween
cout << ph1 << " " << ph2 << " " << ph3 << " " << ph4 << " " << ph5 << " " << ph6 << " " << ph7 << " " << ph8 << " " << ph9 << " " << ph10 << endl;

return 0; // indicate successful termination
} // end function main

____________________________________________________________

I place a single break point at the "return 0;" line.

I click on save .cpp and save all

then lastly i click on the debug button.

That's when i get the error:

"Unable to start the program
C:/Users/TheDevilsWaffle/Documents/Visual Studio 2008/Projects/NewTest/Debug/NewTest.exe

The system cannot find the file specified"

Again...Thank you for your help!
That program doesn't even compile. I don't know why the IDE doesn't report the compiler errors, because it should. Anyway, here's what you did wrong:
You used commas instead of right shift operators (>>) for user input.
You did the same for user output instead of left shift operators (<<).

Other than that, I don't see what else it could be.

See if this one works:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <iostream> // include the iostream library
using std::cout;
using std::cin;
using std::endl;

int main() // start function main
{
	int ph1, ph2, ph3, ph4, ph5, ph6, ph7, ph8, ph9, ph10; // declare ph1-ph10 to store digits that user inputs
	cout << "Welcome to Homework 1 Program A/n Please enter ten digits:" << endl; // display welcome message
	cin >> ph1>> ph2>> ph3>> ph4>> ph5>> ph6>> ph7>> ph8>> ph9>> ph10; // store digits to ph1-ph10
	// display user provided digits in phone number format
	cout << "(" << ph1<< ph2<< ph3 << ")" << ph4<< ph5<< ph6 << "-" << ph7<< ph8<< ph9<< ph10 << endl;
	// display user provided digits with spaces inbetween
	cout << ph1 << " " << ph2 << " " << ph3 << " " << ph4 << " " << ph5 << " " << ph6 << " " << ph7 << " " << ph8 << " " << ph9 << " " << ph10 << endl;

	return 0; // indicate successful termination
} // end function main 
AAAAAAHHH!

Use an array, please.

Unless your homework says not to. ;)
Please, one step at a time.
closed account (zvMoizwU)
Okay, i put that all in.

Like i said, i'm brand new to the C++ world, so i'm still trying to get the basics down, but that being said i'm still running into the same error. The problem is that it still can't find the file that is being specified.

Just another heads up. I installed Visual Basic 2008 Express Edition on my friend's computer that is using Windows XP just to see if the x86 or x64 made a difference. I keep running into the same problem, so i guess that's out.

I'm becoming convinced that maybe there's something wrong with the way i'm setting up the project to begin with. Maybe i'm not checking the right boxes or something. Maybe I'm not saving the program right? I am pressing the two different save button macros that are located on the toolbar to save and i'm not changing the default locations.

Once again, thanks for your patience in dealing with this matter. I've been emailing my professor and still i'm getting no response! You've been very helpful thus far!

As to QWERTYman...I'm just learning (first semester) and i haven't gotten far enough to learn about using arrays. Thank you for your advice, though.
closed account (zvMoizwU)
Oh man! Okay here we go...i actually got it to work. However, i must say i don't quite understand why it didn't work in the first place, unless the debugger was really tripping up over my misuse of the right shift and left shift operators.

I ran the debugger, knowing it wouldn't work properly and ran into this line:

1>.\Debug\TheTest.obj : fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

Since i'm using the Win32 Console Project type it doesn't match up with the previous problem we thought we had with my target machine needing to be X64 and not X86.

So i changed it back to X86 and crossed my fingers that the debugger would work (that was the only error that it reported) and guess what?

It worked!

For the first time i had a console window open up and do its thing!

So this leads me to believe that perhaps the debugger really just didn't like my original set up on the assignment. In which case, thanks to you for finding my operator errors!

Thanks again for the wonderful communication! I only hope that one day i can help you in the future in return!

Thank you again!
`TheDevilsWaffle
Oh, shoot! And I had taken screenshots and was already uploading them.
Oh, well... At least you got it to work.
closed account (zvMoizwU)
What Screenshots? I still don't quite understand why it works now, but i do understand a lot more about the way the program saves information now, thanks to these posts.

Did you have any thoughts about how come this works now?
Topic archived. No new replies allowed.