Frequently Asked Questions
Find answers to common questions about Dev-C++. Use the search box to quickly find what you're looking for, or browse by category.
β οΈ Compilation & Linking Errors
You most probably haven't declared any main() function in your program. Every C/C++ program requires a main() function as the entry point.
Check within Compiler Options if the directories settings are correct. For a default setup, you should have:
C:\DEV-C++\Bin\
c:\DEV-C++\Include\
c:\DEV-C++\Lib\
Make sure these paths match your actual installation directory.
Go to Compiler options, and check if the Lib directory is correctly set to C:\Dev-C++\Lib\ (for a default installation).
If this still doesn't work, try copying the file Lib\crt2.o to your Dev-C++'s Bin directory.
The Mingw compiler understands paths in the Unix style. Replace the backslashes (\) in the filename with forward slashes (/).
For example, use: /Mydir/myfile.h instead of \Mydir\myfile.h
π» Console & Program Execution
You can use an input function at the end of your source to pause the program before it closes. Here are two common approaches:
// Method 1: Using system("PAUSE")
#include <stdlib.h>
int main()
{
// Your code here
system("PAUSE");
return 0;
}
// Method 2: Using getchar()
#include <stdio.h>
int main()
{
// Your code here
printf("Press ENTER to continue.\n");
getchar(); // wait for input
return 0;
} When creating a console application, be sure to uncheck "Do not create a console" in Project Options.
When working with source files only, uncheck "Create for Win32" in Compiler Options. This ensures your program runs in a console window.
π Debugging & Optimization
Go to Compiler Options and click on the Linker sheet. Now check "Generate debugging information". Do a "Rebuild All" and debugging should now be available.
Note: Enabling debugging will increase your executable file size.
To reduce your executable file size (e.g., from 330KB to 12KB):
1. Go to Compiler Options, then click on the Linker page
2. Uncheck "Generate debug information" (you won't be able to debug if you do this)
3. For even more reduction, go to the Optimization page and check "Best optimization"
This removes debugging symbols and optimizes the code for size.
π Libraries & Dependencies
Install the missing DLL file. These are Windows system files that may be missing or outdated on your system.
You can find more information about this issue at Microsoft support pages, or try running Windows Update to ensure your system has all necessary components.
All the libraries that come with the installed Mingw release reside in the Lib directory. They are named in the following way: lib[name].a
To link a library with your project:
1. Go to Project Options
2. In "Further option files" or linker parameters, add: -lopengl32
This is for including the libopengl32.a library. To add any other library, follow the same syntax:
Type -l (lowercase L) plus the base name of the library (filename without "lib" prefix and the ".a" extension).
Examples:
- libopengl32.a β -lopengl32
- libglu32.a β -lglu32
- libws2_32.a β -lws2_32
Yes! A lot of different GUI libraries can be used with Dev-C++ and Mingw, including:
- wxWidgets
- GTK+
- Qt (with some configuration)
- FLTK
- Win32 API (built-in Windows GUI)
Many of these have easy-to-install packages or devpaks available. Check the Dev-C++ community resources and package repositories for pre-configured libraries.
Because conio.h is not part of the C Standard Library. It is a Borland extension that only works with Borland compilers (and some other commercial compilers). Dev-C++ uses GCC, the GNU Compiler Collection.
If you really need conio functions:
1. Include conio.h in your source
2. Add C:\Dev-C++\Lib\conio.o to "Linker Options" in Project Options (where C:\Dev-C++ is your installation directory)
Please note that conio support in GCC is far from perfect and has limited functionality.
π₯οΈ Platform-Specific Issues
This occurs because you are not in Administrator mode, and Dev-C++ tries to write to the registry.
To fix this:
- Log on as Administrator, OR
- Uncheck the file association options in Environment Options, Misc. sheet
This will prevent Dev-C++ from attempting to modify registry settings.
Try to run Windows Update and make sure that you have the Program Compatibility updates installed.
You may also try running Dev-C++ in compatibility mode:
1. Right-click on the Dev-C++ executable
2. Select Properties
3. Go to the Compatibility tab
4. Try different compatibility modes
Some users reported that you need to apply several patches to your system. Here is the list of them (try to retrieve them from Microsoft website or Windows 98 update sites):
- 47569us.exe - labeled as Windows98SE shutdown patch
- dcom98.exe - DCOM update
- DX81eng.exe - latest version of DirectX (11MB, cannot be uninstalled without reinstalling Windows 98)
Note: Try the DirectX update last, as it updates many system components and is irreversible.
There was a Linux version, but it has been abandoned.
The main reason is that Dev-C++ is written in Delphi, and the first Linux version of Delphi (Kylix) wasn't as promising as required for Dev-C++ to be ported.
For Linux development, consider using:
- Code::Blocks
- Eclipse CDT
- Visual Studio Code with C++ extensions
- Qt Creator
- CLion
π Advanced Topics
The "GNU as" assembler uses AT&T syntax (not Intel syntax). Here's an example:
// 2 global variables
int AdrIO;
static char ValIO;
void MyFunction()
{
__asm("mov %dx, _AdrIO"); // loading 16 bits register
__asm("mov %al, _ValIO"); // loading 8 bits register
/*
Don't forget the underscore _ before each global variable name!
*/
__asm("mov %dx, %ax"); // AX --> DX
}
// Note: AT&T syntax is different from Intel syntax
// AT&T: instruction source, destination
// Intel: instruction destination, source To use a module definition (.def) file when creating a DLL:
1. Go to Project Options
2. Find Linker parameters
3. Add: --def yourfile.def
Replace 'yourfile.def' with the actual name of your definition file. Make sure the .def file is in your project directory or provide the full path.
There are two common methods to pause your program:
// Method 1: Using getchar()
#include <stdio.h>
int main()
{
printf("Press ENTER to continue.\n");
getchar(); // wait for input
return 0;
}
// Method 2: Using system("pause")
#include <stdlib.h>
int main()
{
system("pause"); // execute MS-DOS' pause command
return 0;
}
// Note: Method 2 is Windows-specific and less portable π§ General Issues
On some exotic screen systems and resolutions, toolbar icons may show up incorrectly.
Try these solutions:
1. Change your screen resolution
2. Disable toolbars from the View menu in Dev-C++
3. Update your graphics drivers
4. Try running Dev-C++ in compatibility mode
If you want to use the Setup Creator feature of Dev-C++ 4, you need to download and install additional files.
The Setup Creator is an optional component that requires separate installation. Check the Dev-C++ downloads section for the setup creator package.
Alternatively, you can use third-party installer tools like:
- Inno Setup
- NSIS (Nullsoft Scriptable Install System)
- WiX Toolset
No results found
Try different keywords or browse the categories below