Source File Not Compiled Error In Dev C

  1. C++ Compiler Bloodshed
  2. Source File Not Compiled Dev C++ Windows 10
  3. Dev 4.9.9.2
  4. Dev C++ Source File Not Compiled Error

Dec 19, 2009  The progress box no longer shows the resource compiler being activated. Ignore the progress box, the Compile Log text details every command executed and its output. You should post that. The progress box may not correctly parse the output of a custom makefile since it expects the output from a Dev generated makefile. I'm currently using Dev-C 4.9.9.2 and on Windows 8 64 bit. This is literally my first code I made. Anyways, may I have some help? Oct 25, 2007  Dev-C compiling problem. C / C Forums on Bytes. 'source file not compiled' I've seen this question asked a few times on Internet groups. But the problem with an IDE like Dev-C (it is an.IDE., not a compiler) is, that it has to call some other programs like the c pre-processor. Jul 06, 2014  I am really new to C so I can learn to make programs, games, etc. I tried to practice with a code in Dev-C and tried to run it. It gives me 'Source File not compiled'.

C++ Compiler Bloodshed

Source
30 Mar 2020CPOL
In previous versions of Visual Studio, the bundled MFC source files could be compiled into a static library or a DLL. But since Visual Studio 2008, the necessary files to build MFC are not supplied anymore. In this article, I show you how you can compile the MFC sources with Visual Studio 2019.

Introduction

Source File Not Compiled Dev C++ Windows 10

With the latest Visual C++ versions (since 2008), it is not possible anymore to compile the bundled MFC sources. The necessary files, i.e., makefiles like atlmfc.mak and a DEF file are not provided anymore.

In a LOB software project, I needed a x86 MFC DLL without the DAO database classes. With statically linked MFC, I provided my own versions of the DAO classes (which internally use MySQL) by overriding the *dao*.obj files, but MFC object files cannot be overridden when using the DLL form of MFC.

So I took the road to build my own MFC vcxproj files.

The github project https://github.com/fobrs/MFC has all the necessary files to build the MFC sources as a DLL.

Background, DEF file and LTCG

The first hurdle was the missing DEF file. The MFC DLL exports its symbols via a provided Module Definition File or DEF file. The linker uses this DEF file to create the LIB file for the DLL. I couldn't use the old VC++ 2005 DEF file because the MFC feature pack added a lot of new functions.

After some internet search, I discovered the tool: dumpexts.exe. I found the source code of it and modified it a little so it could create a DEF file for all the objs created by the compiler.

The tool is run as a pre-link Build Event for the MFCDLL project. Because Visual Studio has no macro with a list of all obj files, a DOS command enumerates all obj files in the Intermediate directory before calling dumpexts.exe. Be sure to first clean the MFCDLL project so that no old obj files are hiding in it.

When building the DLL the first time, also be sure Link Time Code Generation (LTCG) is not used. The object files the compiler generates when using LTCG cannot be read by dumpexts.exe. Luckily, once when we have generated a DEF file, it can be used in a future LTCG build.

Using the Code

When you clone the Github project, and run the Solution with Visual Studio 2019, a default wizard created MFC application is compiled and run but it uses the private MFC DLL!

To overcome copyright issues, the MFC source files are not included but read during compilation from the $(VCToolsInstallDir) folder. So no original MFC source files are included in the Solution except for one file: ctlpset.cpp. The original file gave a compiler error, so a fixed version is included.

Apparently, there are still bugs present in MFC after all those 28 years!

The current Character Set in the project configuration is set to UNICODE. If you use Multi Byte Character Set, then the file afxtaskdialog.cpp is excluded from the build (unload and edit the project file to see this).

In the original mfcdll.mak file, the source file dllmodul.cpp is compiled twice with different flags. Therefore, this file is copied to dllmodulX.cpp in the MFCstatic project. This project compiles a LIB file which needs to be linked to the EXE which is using the MFC DLL.

The MFCres project is a resource DLL which is a localization for German. However, its use is not very well tested in this project.

Points of Interest

One last point, which I don't understand. I needed to supply the /ENTRY point to all builds except the Release|Win32 build of the main application linker settings. It is set to wWinMainCRTStartup for UNICODE builds.

History

  • 30th March, 2020: Initial version

Dev-C++ FAQ

Click here for Dev-C++ 5 FAQ

Last update: 27/09/2000

Error

1. When I compile my dos program and execute it,Dev-C++ minimizes and then restore in a second but nothingappears ?
2. When executing my dos program, it closesautomatically. How I can change this ?
3. After linking, i get the error“C:DEV-C++LIBlibmingw32.a(main.o)(.text+0x8e): undefinedreference to `WinMain@16'
4. When I launch Dev-C++ i get the message saying“WININET.DLL not found” ?
5. When I compile a file, I get a message saying'could not find <filename> '
6. The EXE files created are huge. What can i doto reduce the size ?
7.Under Windows NT, every time i launch Dev-C++ i get the message“Failed to set data for”
8.When I try to compile I get: ld: cannot open crt2. o: No suchfile or directory. What can i do ?
9.How can i use the OpenGL library and others ?
10. When i compile a file that contains referencesto Windows filename (like <Mydirmyfile.h>), i get a'unrecognized escape sequence' message ?
11. Is there any GUI library or packages availablefor Dev-C++ ?
12. I am having problems using Borland specificfunctions such as clrscr()
13. The toolbars icons are showing incorrectly.
14. It seems i've found a problem/bug that is notspecified here. What should i do ?
15. When attempting to create a setup program, iget the error 'File BinSetup.exe not found'.
16. How to use assembly (ASM) with Dev-C++ ?

1.When I compile my dos program and execute it, Dev-C++ minimizesand then restore in a second but nothing appears ?
When creating a console application, be sure to uncheck “Donot create a console” in Project Options (when working withsource files only uncheck “Create for win32” inCompiler Options).

2.When executing my dos program, it closes automatically. How I canchange this ?
You can use an input function at the end of you source, like thefollowing example :
#include<stdlib.h>
int main()
{
system(
“PAUSE”);
return0;
}


3.After linking, i get the error“C:DEV-C++LIBlibmingw32.a(main.o)(.text+0x8e): undefinedreference to `WinMain@16'
You probably haven’t declared any main() function in yourprogram. Otherwise, try recompiling a second time.

4.When I launch Dev-C++ i get the message saying “WININET.DLLnot found” ?
If you are missing WININET.DLL on your Windows system, you candownload it at:
http://www.rocketdownload.com/supfiles.htm

5.When I compile a file, I get a message saying 'could notfind <filename> '
Check in Compiler options if the direcories settings are correct.With a default setup, you should have :
C:DEV-C++Bin
c:DEV-C++Include
c:DEV-C++Include
c:DEV-C++Lib

Source File Not Compiled Error In Dev C

6.The EXE files created are huge. What can i do to reduce the size?
If you want to reduce your exe file size from 330 Ko to 12 Ko forexample, go to compiler options. Then click on the Linker pageand uncheck 'Generate debug information'. This willremove debugging information (if you want to debug, uncheck it).You can also click on Optimization page and check 'Bestoptimization'.

7.Under Windows NT, every time i launch Dev-C++ i get the message“Failed to set data for”
The is because you are not in Administrator mode, and Dev-C++tries to write to the registry. To get rid of the error message,log on as the Administrator, or uncheck the file associationoptions in Environment options, Misc. Sheet.

8.when I try to compile I get: ld: cannot open crt2. o: No suchfile or directory. What can i do ?
Go to Compiler options, and check if the Lib directory iscorrectly set to:
C:Dev-C++Lib
(for a default installation).

If this stilldoesn't work, try copying the file Libcrt2.o to your Dev-C++'sBin directory.

9.How can i use the OpenGL library and others ?
All the libraries that comes with Mingw reside in the Libdirectory. They are all named in the following way: lib*.a
To link a library with your project, just add in Project options,Further option files :
-lopengl32
This is for including the libopengl32.a library. To add any otherlibrary, just follow the same syntax:
Type -l (L in lowercase) plus the base name of the library(filename without 'lib' and the '.a'extension).

10.When i compile a file that contains references to Windowsfilename (like <Mydirmyfile.h>), i get a 'unrecognizedescape sequence' message ?

The Mingw compilerunderstands paths in the Unix style (/mydir/myfile.h). Tryreplacing the in the filename by /

11.Is there any GUI library or packages available for Dev-C++ ?

You can downloadextra packages for Dev-C++ at http://www.bloodshed.net/dev/

12.I am having problems using Borland specific functions such asclrscr()

Include conio.h toyour source, and add C:Dev-C++Libconio.o to 'FurtherObject Files' in Project Options (where C:Dev-C++ is whereyou installed Dev-C++)

13.The toolbars icons are showing incorrectly.

Dev 4.9.9.2

On some screenresolutions, toolbars icons may show up incorrectly. You shouldtry changing your screen resolution, or disable toolbars from theView menu in Dev-C++

14. It seems i've found a problem/bug thatis not specified here. What should i do ?

First, you shouldtry doing a 'Check for Dev-C++ update' (in Help menu)to know if a new version has come that may correct this problem.If there are no new version or the problem wasn't fixed thenplease send an email describing the bug to : webmaster@bloodshed.net

15.When attempting to create a setup program, i get the error'File BinSetup.exe not found'.

If you arewilling to use the Setup Creator feature of Dev-C++, you need to download and install thisfile

Dev C++ Source File Not Compiled Error

16.How to use assembly with Dev-C++ ?

The assembler uses AT&T (notIntel). Here's an example of such a syntax :
// 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 names !
*/
__asm('mov %dx,%ax') ; // AX --> DX
}