You are here:

C++/C++ compiler porblem


I have developed a project using C++ with many different .cpp files (main.cpp,window.cpp,courses.cpp etc.) and i included these files to another cpp file with #include<file_name.cpp> and i am getting a error message that "Unable to include file file_name.cpp". I have also taken inbuilt help it was suggested to check config.sys file for a line FILES=20 i have done that also. I am using Borland Turbo C++ 3.x. Pleas help to get out of this problem. OS is Windows xp professional

First I think config.sys has very little meaning in the world of Windows XP.

Second I am unfamiliar with Borland Turbo C++ 3.0, but a quick look at Wikipedia ( shows it is very old (1991) and intended for MS-DOS development (unless you have the Windows version - for 16-bit Windows development presumably). In which case you might like to consider upgrading to a newer compiler such as the Microsoft Visual C++ 2005 Express edition, which is free or maybe a free version of a Borland compiler - the C++ Turbo Explorer edition looks like it could be a suitable choice. A good place to start would be (see, specifically free C++ compilers (see

Now your main problem is that the compiler pre-processor that handles directives such as #include cannot find the file you are asking it to include. As these are application source files and not C++ system files you should use double quotes rather than angle brackets around the file pathname:

   #include "file_name.h"

Often the above form will search the directory containing the file containing the #include directive for files to include whereas the <> form will not. However exactly how the two forms search for the file to include is implementation dependent.

As with finding any file you have to ensure that the compiler pre-processor is looking for the correct thing in the correct place(s):

   - check where <> and "" forms of #include try to locate the
     specified file in the compiler documentation
   - check the spelling of the file names
   - check the files are actually where you think they are and are
     named exactly as you think they are!
   - as this seems to be an old MS-DOS compiler then you might have to
     restrict your file names to FAT 8.3 file name format - which seems
     to be OK in this case as your filenames seems to fit this format.
     However modern Microsoft file systems keep both long file names
     and MS-DOS short names for all file names, so this could possibly
     become a problem!

Note in my example that I have used a file with a .h extension. This is because you usually do _not_ include source code implementation files in each other. Instead you break the code into shared definitions/declarations and private implementation sections. The former you place into a header file that is shared with implementation files and the latter you place in the implementation files. Header files have the extension .h, .hpp, .hxx or similar, and implementation files have the extension .cpp, .cxx, .cc or similar. This is by convention and not firmly enforced.

You then individually compile each implementation file. The output from this process is a set of object code files. These object files are then linked together, together with any libraries you are using, to form an executable using a linker. Note that the use of object here in the context of object files and object code is not the same use of object as in a C++ class instance, and pre-dates the C++ usage.

Hope this is some help.  


All Answers

Answers by Expert:

Ask Experts


Ralph McArdell


I am a software developer with more than 15 years C++ experience and over 25 years experience developing a wide variety of applications for Windows NT/2000/XP, UNIX, Linux and other platforms. I can help with basic to advanced C++, C (although I do not write just-C much if at all these days so maybe ask in the C section about purely C matters), software development and many platform specific and system development problems.


My career started in the mid 1980s working as a batch process operator for the now defunct Inner London Education Authority, working on Prime mini computers. I then moved into the role of Programmer / Analyst, also on the Primes, then into technical support and finally into the micro computing section, using a variety of 16 and 8 bit machines. Following the demise of the ILEA I worked for a small company, now gone, called Hodos. I worked on a part task train simulator using C and the Intel DVI (Digital Video Interactive) - the hardware based predecessor to Indeo. Other projects included a CGI based train simulator (different goals to the first), and various other projects in C and Visual Basic (er, version 1 that is). When Hodos went into receivership I went freelance and finally managed to start working in C++. I initially had contracts working on train simulators (surprise) and multimedia - I worked on many of the Dorling Kindersley CD-ROM titles and wrote the screensaver games for the Wallace and Gromit Cracking Animator CD. My more recent contracts have been more traditionally IT based, working predominately in C++ on MS Windows NT, 2000. XP, Linux and UN*X. These projects have had wide ranging additional skill sets including system analysis and design, databases and SQL in various guises, C#, client server and remoting, cross porting applications between platforms and various client development processes. I have an interest in the development of the C++ core language and libraries and try to keep up with at least some of the papers on the ISO C++ Standard Committee site at


©2016 All rights reserved.