Solved

Can't Get Simple Program to Run

Posted on 1998-01-07
7
203 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

740 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