473,320 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Dev-C++ Vista cstddef

Hi, I just got a new computer with vista and cannot compile a single program in DevC+
Here is my code:
Expand|Select|Wrap|Line Numbers
  1. //
  2. //  Program to convert temperature from Celsius degree
  3. //  units into Fahrenheit degree units:
  4. //  Fahrenheit = Celsius  * (212 - 32)/100 + 32
  5. //
  6. #include <cstdio>
  7. #include <cstdlib>
  8. #include <iostream>
  9. using namespace std;
  10.  
  11. int main(int nNumberofArgs, char* pszArgs[])
  12. {
  13.   // enter the temperature in Celsius
  14.   int celsius;
  15.   cout << "Enter the temperature in Celsius:";
  16.   cin >> celsius;
  17.  
  18.   // calculate conversion factor for Celsius
  19.   // to Fahrenheit
  20.   int factor;
  21.   factor = 212 - 32;
  22.  
  23.   // use conversion factor to convert Celsius
  24.   // into Fahrenheit values
  25.   int fahrenheit;
  26.   fahrenheit = factor * celsius/100 + 32;
  27.  
  28.   // output the results (followed by a NewLine)
  29.   cout << "Fahrenheit value is:";
  30.   cout << fahrenheit << endl;
  31.  
  32.   // wait until user is ready before terminating program
  33.   // to allow the user to see the program results
  34.   system("PAUSE");
  35.   return 0; 
  36. }
When I compile it, I get 326 errors and another file called cstddef opens with this:
Expand|Select|Wrap|Line Numbers
  1. // -*- C++ -*- forwarding header.
  2.  
  3. // Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
  4. //
  5. // This file is part of the GNU ISO C++ Library.  This library is free
  6. // software; you can redistribute it and/or modify it under the
  7. // terms of the GNU General Public License as published by the
  8. // Free Software Foundation; either version 2, or (at your option)
  9. // any later version.
  10.  
  11. // This library is distributed in the hope that it will be useful,
  12. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. // GNU General Public License for more details.
  15.  
  16. // You should have received a copy of the GNU General Public License along
  17. // with this library; see the file COPYING.  If not, write to the Free
  18. // Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  19. // USA.
  20.  
  21. // As a special exception, you may use this file as part of a free software
  22. // library without restriction.  Specifically, if other files instantiate
  23. // templates or use macros or inline functions from this file, or you compile
  24. // this file and link it with other files to produce an executable, this
  25. // file does not by itself cause the resulting executable to be covered by
  26. // the GNU General Public License.  This exception does not however
  27. // invalidate any other reasons why the executable file might be covered by
  28. // the GNU General Public License.
  29.  
  30. //
  31. // ISO C++ 14882: 18.1  Types
  32. //
  33.  
  34. /** @file cstddef
  35.  *  This is a Standard C++ Library file.  You should @c #include this file
  36.  *  in your programs, rather than any of the "*.h" implementation files.
  37.  *
  38.  *  This is the C++ version of the Standard C Library header @c stddef.h,
  39.  *  and its contents are (mostly) the same as that header, but are all
  40.  *  contained in the namespace @c std.
  41.  */
  42.  
  43. #ifndef _CPP_CSTDDEF
  44. #define _CPP_CSTDDEF 1
  45.  
  46. #pragma GCC system_header
  47.  
  48. #include <stddef.h>
  49.  
  50. namespace std 
  51. {
  52.   using ::ptrdiff_t;
  53.   using ::size_t;
  54. }
  55.  
  56. #endif
I have tried to include <stddef.h> but it makes no difference. Anyone can help, I fell so miserable ...
Oct 15 '07 #1
6 4771
weaknessforcats
9,208 Expert Mod 8TB
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.
Oct 16 '07 #2
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 ...
Oct 16 '07 #3
weaknessforcats
9,208 Expert Mod 8TB
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??
Oct 17 '07 #4
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 !!
Oct 17 '07 #5
weaknessforcats
9,208 Expert Mod 8TB
Bloody Hell, how can that be ???

I have checked the settings, everything seems OK.
Contact your compiler vendor.
Oct 18 '07 #6
r035198x
13,262 8TB
I've used Dev-C++ on Vista without problems.
What happens if you remove

Expand|Select|Wrap|Line Numbers
  1.  #include <cstdio>
  2. #include <cstdlib>
and leave the include for iostream only?
Oct 18 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
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...
0
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...
0
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
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...
0
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...
0
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...
1
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)...
1
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....
0
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.