使用 g++ 编译器

使用 g++ 编译器

我的桌面上有一个名为 Conversion.cc 的简单程序 &.显示如下

//
// Conversion - Program to convert temperature from
//            Celsius into Fahrenheit:
//            Fahrenheit = Celsius * (212 -32)/100 +32
//
#include <studio>

#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
  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 << end];
  
  //wait until user is ready before terminating program
  //to allow the user to see program results
  system("PAUSE");
  return 0;
  }  

我去用g++编译了一下,结果如下

Desktop$ g++ -o Conversion Conversion.cc
Conversion.cc:6:10: fatal error: studio: No such file or directory
    6 | #include <studio>
      |          ^~~~~~~~
compilation terminated.

Desktop$ g++ -o Conversion Conversion.cc
Conversion.cc:6:10: fatal error: studio: No such file or directory
    6 | #include <studio>
      |          ^~~~~~~~
compilation terminated.

相关内容