Click here to Skip to main content
15,868,010 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi!
I am using Dev-C++ and when I am trying to compile a program in it, it is showing many errors. All the settings seems to be right. Can I compile a program including header files like conio.h and iostream.h and using namespace std in Dev-C++? If not please suggest a good compiler in which I can do a program containing the header files mentioned above. I tried doing the same program in turbo C++ and microsoft visual studio 2010 express and it is working properly. If this problem in Dev-C++ is due to any settings that has to be done, please tell. I have installed Dev-C++ correctly.
Someone, please help me out!

[edit]Spurious formatting removed - OriginalGriff[/edit]
Posted
Updated 26-Dec-17 20:39pm
v2

conio.h isn't a standard C++ header, see, for instance conio.h at Wikipedia[^].
iostream.h is the old stream library header, new programs should use iostream instead.
You should report the error messages to get better help.
 
Share this answer
 
I'd suggest you at least investigate Code::Blocks.
If nothing else, you'll be more aware of your choices and their suitability to you.

Lightweight, gcc, multi-platform use. (much, much faster IDE than VS, more useful than DevCpp, up to date MinGW compiler)

The VS intellisense can be nice, or it can be intelinonsense dependant on the frame of mind of both you and the IDE. It's more verbose than Code::Blocks', though I find the speed penalty not worth-while.
I only touch VS when doing mfc/.net stuff - hate it(the ide). I don't require a lot of the IDE's functionality and am reluctant to put up with all of it's carry-on, regardless of the fact that work has forked-out a good sum of $ for a license for me.
 
Share this answer
 
Member 8060663 wrote:
I tried doing the same program in turbo C++ and microsoft visual studio 2010 express and it is working properly.

So why not work with one of those instead? This is almost for sure an IDE configuration/installation problem. What are the errors you are seeing?
 
Share this answer
 
v2
Comments
Member 8060663 6-Jul-11 2:16am    
This is a program that I tried out.

#include<iostream.h>
void main()
{
cout<<"Welcome to microchip Computer Education";
}
These are the errors that are shown-

Line:1
File:C:\Dev-Cpp\include\c++\3.4.2\backward\iostream.h:31,from D:\CPPdoc\welcome to microchip computer education.cpp
Message:In file included from C:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31, from D:\CPPdoc\welcome to microchip computer education.cpp

Line:1
File:\CPPdoc\welcome to microchip computer education.cpp
Message:from D:\CPPdoc\welcome to microchip computer education.cpp

Line:32:2
File:C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h
Message:#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <x> header for the <x.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.

Line:3
File:\CPPdoc\welcome to microchip computer education.cpp
Message:`main' must return `int'
This program compiles properly in Turbo C++. I don't understand why Dev-C++ 4.9.9.2 is giving errors.

Please help me!
Albert Holguin 6-Jul-11 10:09am    
enhzflep posted a reply, but it looks like he posted it as a comment to me...
enhzflep 6-Jul-11 11:32am    
Oops, sorry about that Albert. It certainly wasn't my intention for it to seem like that. I'd intended to reply to 'Member 8060663'
Cheers,
Simon :)
enhzflep 6-Jul-11 8:10am    
"This program compiles properly in Turbo C++. I don't understand why Dev-C++ 4.9.9.2 is giving errors."
That's because TurboC++ is letting you get away with it - not because DevCpp is being unreasonable. The current standard is as the error message suggests - "main" must return an int.

I forget what it is, though I'm sure there's a compiler option you can toggle to make this (useful) message go away.

There's a million and one threads around where people have a problem making a program that contains "void main()" work. Typically, it is a result of looking at old resources when trying to use new(er) build tools.
I've just got home to my desktop and realized that it's got the old version of CodeBlocks installed - download the current one as we speak. Again, I cannot speak highly enough of this fantabulous piece of software.
(You can actually make CodeBlocks use any compiler that you have installed on your system, on a project-by-project basis. - be it x86, x64, risc, mips, microchip, atmel, MSVC, gcc, whatever)
Member 8060663 6-Jul-11 10:56am    
What is CodeBlocks? Do you mean I can't do these kind of programs in Dev-C++?
Can you suggest some good compilers in which I will be able to compile programs involving iostream.h, math.h and conio.h? I am new to C++ and I am studying C++ in 11th. So, I need to do only such easy programs for practice and not complicated programs. Can you also tell which C++ compilers are used for developing games?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900