Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Can't Get Simple Program to Run

Posted on 1998-01-07
7
200 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

860 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