Solved

Can't Get Simple Program to Run

Posted on 1998-01-07
7
195 Views
Last Modified: 2010-04-10
This is the program:
#include <iostream.h>
void main()
   {
   cout << "Every age has a language of its own";
   }
Can't get any simpler than that, yet I can't get Borland C++ 5.01 to make it into a working executable file (it makes an .exe file out of it, but when I try to run it says "Not a valid Win32 Application").  How can I make this program into a valid executable with BC5's project options (using Text Edit is not an option)?
0
Comment
Question by:Jose_G
7 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1177816
I'm not familiar with Borland C, but the basic problem is that it is trying to create a windows program and you want it to create a console (MS DOS) program.  Look for some project settings that indicate the type of executable to be produced.  (You might have to create a new projact as these settings might not be alterable after a project has been created.
0
 
LVL 4

Expert Comment

by:marko020397
ID: 1177817
You should set in application properties that this is
a console application. It should not be a GUI application.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1177818
That's exactly what I said.  Unless he knows how to do so, or you can tell hime how to do, that is not much help.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:Jose_G
ID: 1177819
I think I should have re-worded my question.  For a program such as that (extremely simplistic), what are the project settings I should use so that when I have BC5 run the program it makes a valid executable?
0
 
LVL 22

Expert Comment

by:nietod
ID: 1177820
I don't know, because I use Visual C.  However, if no one else can help, look for settings about a "console" application or a "DOS" application.  Not a "Windows" or "GUI" application.
0
 
LVL 22

Expert Comment

by:nietod
ID: 1177821
For what its worth.  In vissual C, you can't change these settings for an existing project.  You must specify them when the project is created.  If Borland is the same, you need to create a new project from scratch.
0
 
LVL 32

Accepted Solution

by:
jhance earned 20 total points
ID: 1177822
From the MSDOS command line, the following will build, and link a BCC MSDOS command line application:

C:\FILES>BCC -IC:\BC5\INCLUDE -LC:\BC5\LIB yourfile.cpp

Note that the C:\BC5\INCLUDE and C:\BC5\LIB are installation dependent and may be different on your system.  The -I specifies where the include files are to be found.  The -L specifies where the linker should find the runtime library files.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question