#### Archived

This topic is now archived and is closed to further replies.

# Compile Errors

This topic is 5421 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How am i suposed to learn C++ programming if all of the compilers i get give me these errors. I have tried to use both DJGPP and Dev-C++ and the same errors pop up. I have an xp comp it runs well ussually but so many errors could that be part of the error? Here is the programming code whats wrong with it? // // Conversion - convert temperature from Celsius // degree units into Fahrenheit degree units: // Fahrenheit = Celsius * (212 - 32)/100 + 32 // #include <stdio.h> #include <iostream.h> int main(int nNumberofArgs, char* pszArgs[]) { // enter the temperature in Celsius int nCelsius; cout << "Enter the temperature in Celsius:"; cin >> nCelsius; // calculate conversion factor for Celsius // to Fahrenheit int nFactor; nFactor = 212 - 32; // use conversion factor to convert Celsius // into Fahrenheit values int nFahrenheit; nFahrenheit = nFactor * nCelsius/100 + 32; // output the results cout << "Fahrenheit value is:"; cout << nFahrenheit; return 0; } When i hit compile the errors in the bottom pop up. C:\wecc\programs\Conversion.cpp [Warning] In function int main(int, char**)': 10 C:\wecc\programs\Conversion.cpp cout' undeclared (first use this function) 10 C:\wecc\programs\Conversion.cpp (Each undeclared identifier is reported 11 C:\wecc\programs\Conversion.cpp cin' undeclared (first use this function) 16 C:\wecc\programs\Conversion.cpp nfactor' undeclared (first use this 21 C:\wecc\programs\Conversion.cpp nFactor' undeclared (first use this [edited by - ApparitionX on March 18, 2003 3:23:39 PM]

##### Share on other sites
Now that i have tried to use differnet program have gotten more errors for this simple program.

#include <iostream.h>

int main ()
{
cout << "stupid piece of...";
return 0;
}

22 C:\Documents and Settings\Eric Viveiros\Desktop\Untitled1.cpp:1
iostream.h: No such file or directory.

C:\Documents and Settings\Eric Viveiros\Desktop\Untitled1.cpp
[Warning] In function int:

5 C:\Documents and Settings\Eric Viveiros\Desktop\Untitled1.cpp
`cout''

5 C:\Documents and Settings\Eric Viveiros\Desktop\Untitled1.cpp
(Each

##### Share on other sites
Its not a problem with the code, its a problem with the compiler set up. Make sure you have the library and include directorys set in the compiler options.

##### Share on other sites
1. When using the standard C++ libraries, you do not use the .h extension. Some (old and outdated) tutorials may refer to them like that, but it isn''t guaranteed to work anymore.

2. All of the standard library classes and functions are in the std namespace. You don''t need to care about namespaces yet; you just need to put "using namespace std;" after the #include line. Again, this is something that outdated tutorials might miss.

How appropriate. You fight like a cow.