hei
May I know how to handle dev cpp;

It shows error even for simple programs which I had successfully run in turbo c 3.0

Dani AI

Generated

Brief expert note to complement the replies from , , and — focused, practical checks and migration options to stop the flood of errors and get Turbo C code running or ported.

Most common causes

  • Dev-C++ installed without a compiler (many builds were distributed that way). Confirm a working MinGW/GCC is present (look for g++.exe in the IDE's "bin" folder or in Tools/Compiler settings).
  • Code written for old Turbo C uses Borland-only headers and BGI/text-console calls. One parse or include failure will cascade into hundreds of follow-on errors; fix the first error shown and recompile.

Practical checklist

  • Save source with a .cpp extension and ensure the project is set to compile as C++.
  • Update headers to the standard C++ ones and use std:: or a using-declaration where appropriate (modern compilers expect the standard headers).
  • Replace nonstandard console functions (clrscr, gotoxy, getch) with portable alternatives or standard I/O/streams; for interactive console control, consider a cross-platform library (ncurses on Unix, a Windows console API wrapper, or a small compatibility layer).
  • If the goal is to run the original Turbo C binary/behavior unchanged, run Turbo C under DOSBox (emulates the DOS environment).

Graphics options (car-racing program)

  • Quick compatibility: use a BGI-compatibility package for MinGW (commonly called WinBGIm) so many graphics.h calls compile with minimal edits.
  • Longer-term: port graphics to a modern, cross-platform library (SDL2, SFML, Allegro, or OpenGL) for better performance and portability.

Quick compile example (command line to isolate IDE issues)

g++ -std=c++17 -Wall -Wextra -o program.exe program.cpp

Recommended IDEs/toolchains: Code::Blocks + MinGW(-w64), Visual Studio Community (Windows), or VS Code with MinGW-w64. For large error dumps, focus on the first reported error — later messages often follow from that single root cause.

Recommended Answers

All 12 Replies

I also use the same compiler. In order to help you, can you provide sample program that is not working/compiling so folks can help you.

You both should ditch that compiler and use Code::Blocks with MinGW instead because they are newer and still actively supported. Dev-C++ has not been updated in quite a few years and uses an older version of gcc/g++ compilers.

hei
May I know how to handle dev cpp;

It shows error even for simple programs which I had successfully run in turbo c 3.0

Now I've never used turbo c before, but I have used Dev-C++ way back in the days when it was still under development. There are a few things that could explain why things aren't compiling. First, you could have downloaded a version of DevC++ that comes without a compiler, so it's complaining that the compiler is missing. Or you could also be doing something that is specific to Turbo C (non standard code) that won't compile on anything else. I've never used turbo c, but I've heard rumors about it on the net here and there. It's hard to tell exactly because you haven't given us much to work with.

I do agree with Ancient Dragon though. DevC++ hasn't been developed in years and it was abandoned because the authors thought that it was buggy if I remember correctly. Download something else like Code::Blocks and use that instead. You'll at least have a recent IDE and a recent version of Mingw.

#include<iostream.h>
#include<conio.h>
int main()
{
cout<<"Testing...";
return(0);
}
compailor show error even for this code.
Not one and two errors but 324!!!
How it is possible?

commented: Try posting using code tags, read the intro thread; Try saying what the ACTUAL error messages were. "there are error" is a useless thing to say without context. -3

What kind of errors are you getting?

Your program compiles just fine in Code::Blocks using the current version of Mingw.

I'm wondering if you have Mingw installed on your computer. Could you double check for us please? There were 2 versions of DevC++, one with a compiler and the other without. You may have the one without the compiler... hence the errors. No way of knowing without reading a few of the errors though or checking your install.

Also, conio.h is not really a part of standard C/C++. Try compiling without that line and see if you have any luck. I'll quote wikipedia on that one: "conio.h is a header file used in old MS-DOS compilers to create text user interfaces. It is not part of the C programming language, the C standard library, ISO C nor is it required by POSIX."

1) iostream.h is obsolete -- use <iostream> instead (without the .h extension. Current c++ standards have removed the .h extension in all its header files.

2) conio.h -- that is a non-standard header file that was originally implemented by Borland compilers such as Turbo C. It was picked up by a few other compilers, but implementations were often not the same. That header file never did become part of the C or C++ standards. You should delete conio.h from your programs unless it contains something you absolutely can not live without. In that case don't complain if other compilers refuse to compile your programs.

Try this version:

#include<iostream>
#include<conio.h>
using namespace::std;
int main()
{
   cout<<"Testing...";
   system("PAUSE");
   return(0);
}

Here are the fixes:
1. <iostream.h> changed to <iostream>.
2. missing namespace added the line "using namespace::std;
3. In order to see the output I added the system("PAUSE");


For the gentleman who suggested using another compiler. I totally agree. I use this particular one since many colleges use it when teaching C++ and I like to use the same tool someone is using when they have a problem. Dev-Cpp is free.

Hope the above helps.

system("pause"); is not the best way to prevent the program from exiting. Using an alternative like cin.get() would be preferred.

Example:

cout << "Paused...\n";
    cin.get();

OK..
That program was successfull
But how can I change complicated programs to dev-ccp
Eg:- The car racing program published in daniweb by me done in turbo c.

Why dev-cpp donot support graphics?

programs originally written with turbo c can not be easily ported to other modern compilers due to the differences in the graphics. I suppose you could port all the functions in graphics.h to use win32 api graphics functions, but it might be easier just to rewrite the turbo c program.

clrscr(); is not work in devcpp...why???????????

because it, along with conio.h, isn't a standard c function. Not very many compilers support it. That's the unfortunate consequences of learning to program on ancient 30-year-old compilers such as Turbo C and Turbo C++. They were good IDEs in their days but have long been obsolete.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.