Eclipse Error 'Program File Does Not Exist'

  • Context: C/C++ 
  • Thread starter Thread starter Void123
  • Start date Start date
  • Tags Tags
    Eclipse Error File
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting a programming error encountered while using Eclipse to run a C++ program intended to convert Celsius to Fahrenheit. Participants explore potential causes of the error message 'program file does not exist' and examine issues within the provided code.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant expresses a lack of familiarity with the programming language and seeks help with errors encountered in their code.
  • Another participant notes that compiler errors can prevent the generation of a program file, which is necessary for debugging, and points out a malformed comment in the code.
  • A participant critiques the conversion formula used in the code, suggesting it is unnecessarily complicated but equivalent to a simpler formula.
  • Concerns are raised regarding the correctness of the conversion formula, with one participant stating it does not function as intended for values below the boiling point of water.
  • Another participant agrees with the critique of the formula and adds that integer division in C and C++ can lead to unexpected results unless the input is a multiple of 10.
  • A participant inquires about the compiler being used in Eclipse and suggests that the error may stem from missing plugins, recommending the use of a different IDE as a potential solution.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the cause of the error or the correctness of the code. Multiple competing views regarding the conversion formula and the IDE setup remain present.

Contextual Notes

There are unresolved issues regarding the specific compiler settings and configurations in Eclipse, as well as the implications of integer division in the provided formula.

Void123
Messages
138
Reaction score
0
I am pretty ignorant of this language. I am working from a '...for dummies' book to teach myself and after the first few pages I have already stumbled upon a problem. I have attached a code, pretty simple one, which I'm trying to run but there are some errors and I don't know how to resolve them. I am using eclipse and when I debug I get a message which says 'program file does not exist.' If someone can help me with this I would appreciate it.
 

Attachments

Technology news on Phys.org
What errors are you getting? If there are compiler errors (as opposed to warnings), the compiler will not generate a program file, so you can't debug.

The first thing I notice is a malformed comment ( / ) in the first line.

Something much less serious, but not incorrect, is the conversion formula, which is more complicated than it needs to be.
Fahrenheit = Celsius *(212 - 32)/100 + 32

This is exactly the same as Fahrenheit = Celsius *9/5 + 32, since (212 - 32)/100 = 180/100 = 9/5.
Code:
/
// Program to convert temperature from Celsius degree units into Fahrenheit degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius *(212 - 32)/100 + 32
//
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[])
{
// enter the temperature in Celsius
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
// calculate conversion factor for Celsius
// to Fahrenheit values
int factor;
factor = 212 - 32;

// use conversion factor to convert Celsius
// into Fahrenheit values
int fahrenheit;
fahrenheit = factor * celsius/100 + 32;

// output the results (followed by a NewLine)
cout << "Fahrenheit value is";
cout << fahrenheit << endl;

// wait until user is ready before terminating program
// to allow the user to see the program results
system("PAUSE");
return 0;

}
 
fahrenheit = factor * celsius/100 + 32;

Doesn't do what you think it does.
For anything below boiling point it will return 32.
 
mgb_phys said:
fahrenheit = factor * celsius/100 + 32;

Doesn't do what you think it does.
For anything below boiling point it will return 32.
I agree with the "doesn't do what you think it does" part, but if celsius is a multiple of 10, the formula will give the right result. If celsius is not a multiple of 10, the results will be surprising to someone who doesn't understand integer division in C and C++.

The * and / operators are at the same precedence level, and are evaluated left to right.
 
Mark44 said:
What errors are you getting? If there are compiler errors (as opposed to warnings), the compiler will not generate a program file, so you can't debug.

The first thing I notice is a malformed comment ( / ) in the first line.

I corrected it, but its still doing the same thing.
 
You're running it in eclipse? With what compiler? My guess with that error message is that you don't have the right plugins installed in the IDE. I've never worked with C++ in eclipse, but I think there is a development kit called CDT that you can use. Did you try a different IDE? I got this code to work in visual studio, so I don't know what the problem is.

The only thing is you have to add the standard header file
#include "stdafx.h"

Let us know if you're still getting errors and what they say. See if you can get it to compile with something besides eclipse.
 

Similar threads

  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
7
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 6 ·
Replies
6
Views
12K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K