Hi, I just got a new computer with vista and cannot compile a single program in DevC+
Here is my code: - //
-
// Program to convert temperature from Celsius 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
-
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;
-
}
When I compile it, I get 326 errors and another file called cstddef opens with this: - // -*- C++ -*- forwarding header.
-
-
// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
-
//
-
// This file is part of the GNU ISO C++ Library. This library is free
-
// software; you can redistribute it and/or modify it under the
-
// terms of the GNU General Public License as published by the
-
// Free Software Foundation; either version 2, or (at your option)
-
// any later version.
-
-
// This library is distributed in the hope that it will be useful,
-
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-
// GNU General Public License for more details.
-
-
// You should have received a copy of the GNU General Public License along
-
// with this library; see the file COPYING. If not, write to the Free
-
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-
// USA.
-
-
// As a special exception, you may use this file as part of a free software
-
// library without restriction. Specifically, if other files instantiate
-
// templates or use macros or inline functions from this file, or you compile
-
// this file and link it with other files to produce an executable, this
-
// file does not by itself cause the resulting executable to be covered by
-
// the GNU General Public License. This exception does not however
-
// invalidate any other reasons why the executable file might be covered by
-
// the GNU General Public License.
-
-
//
-
// ISO C++ 14882: 18.1 Types
-
//
-
-
/** @file cstddef
-
* This is a Standard C++ Library file. You should @c #include this file
-
* in your programs, rather than any of the "*.h" implementation files.
-
*
-
* This is the C++ version of the Standard C Library header @c stddef.h,
-
* and its contents are (mostly) the same as that header, but are all
-
* contained in the namespace @c std.
-
*/
-
-
#ifndef _CPP_CSTDDEF
-
#define _CPP_CSTDDEF 1
-
-
#pragma GCC system_header
-
-
#include <stddef.h>
-
-
namespace std
-
{
-
using ::ptrdiff_t;
-
using ::size_t;
-
}
-
-
#endif
I have tried to include <stddef.h> but it makes no difference. Anyone can help, I fell so miserable ...
6 4771
What is the first error??
Often, the first error causes a lot of the others. If you just keep fixing the first error, the others will disappear quickly.
If it's any consolation, your code compiles and links with no warnings and no errors using Visual Studio.NET 2005.
I suspect your compiler has not been properly installed.
Thanks a lot for answering so quickly.
I have tried to reinstall it and I have been very careful with the instructions.
I am gonna have a look at Visual Studio.
Here are my first errors:
48 C:\Dev-Cpp\include\c++\cstddef
In file included from C:/Dev-Cpp/include/c++/cstddef
50 C:\Dev-Cpp\include\c++\cstdio
from C:/Dev-Cpp/include/c++/cstdio
6 C:\Users\pc user\Documents\C++\Untitled1.cpp
from C:/Users/pc user/Documents/C++/Untitled1.cpp
24 C:\Dev-Cpp\include\stddef.h:6
no include path in which to find stddef.h
50 C:\Dev-Cpp\include\c++\cstdio
In file included from C:/Dev-Cpp/include/c++/cstdio
6 C:\Users\pc user\Documents\C++\Untitled1.cpp
from C:/Users/pc user/Documents/C++/Untitled1.cpp
52 C:\Dev-Cpp\include\c++\cstddef
`ptrdiff_t' not declared
53 C:\Dev-Cpp\include\c++\cstddef
`size_t' not declared
And it keeps going on and on and on ...
48 C:\Dev-Cpp\include\c++\cstddef
In file included from C:/Dev-Cpp/include/c++/cstddef
Have you noticed that one path is a Windows path and the other is a Unix path??
Does you compiler think you are on Unix when you are on Windows??
Bloody Hell, how can that be ???
I have checked the settings, everything seems OK.
Do I really have to give up C++ because of that ... and go back to doing VBA and SQL ... Oh no !!
Bloody Hell, how can that be ???
I have checked the settings, everything seems OK.
Contact your compiler vendor.
I've used Dev-C++ on Vista without problems.
What happens if you remove - #include <cstdio>
-
#include <cstdlib>
and leave the include for iostream only?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: renagade629 |
last post by:
Can anybody help me understand what i'm doing wrong or what I'm missing? Is there anyother good and commendable C++ program I can use (free) from the internet like Dev C++? I'm having trouble doing...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |