Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C++ Project in Borland C++ 4.52

Posted on 2000-02-20
9
Medium Priority
?
951 Views
Last Modified: 2008-02-01
Hi

I'm just a beginner in C++, and now I have a problem with the "thing" called project. I have a lot of files, which I want to put into a project. Do anyone of you have an idea how to do that in BC++ 4.52.

When I Choose Project -> New Project, three files are beeing generated. (ex : test.cpp, test.def and test.rc). What are these files used to. I've tried putting some code into test.cpp and then tried to run the program. But nothing happens.

Can anyone help me??
0
Comment
Question by:Batalf
[X]
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
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 32

Author Comment

by:Batalf
ID: 2540360
If someone could give me a good instruction I would raise the points even more. I'm a beginner in C++ but have it as a subject at school so it's wery important for me to get it work.

Thanks in advance :-)

Batalf
0
 
LVL 1

Expert Comment

by:aperdon
ID: 2540466
These files are just created to get you starting to write code.
You are able to do not BC4.51 create these files. In the NewProject-dialog you should click the Advanced button. In this dialog you can choose between .cpp, .c, or no source node. Also you can set whether or not to create a .def-file and/or .h-file.
Probably you know the use of .cpp/.c (source) and .h (header). The .def-file is used to set your compiler-settings. As you are new to this, you will not be interested in this file. If you set the radio-button to no-source and unset the other two check-boxes, you will start with an empty project.
After creating the empty project you can add nodes (=your source files).
A project always needs a file wich contains the main-function. If this function exists then your project will link correctly and will run.
0
 
LVL 1

Accepted Solution

by:
aperdon earned 450 total points
ID: 2540495
These files are just created to get you starting to write code.
You are able to do not BC4.51 create these files. In the NewProject-dialog you should click the Advanced button. In this dialog you can choose between .cpp, .c, or no source node. Also you can set whether or not to create a .def-file and/or .h-file.
Probably you know the use of .cpp/.c (source) and .h (header). The .def-file is used to set your compiler-settings. As you are new to this, you will not be interested in this file. If you set the radio-button to no-source and unset the other two check-boxes, you will start with an empty project.
After creating the empty project you can add nodes (=your source files).
A project always needs a file wich contains the main-function. If this function exists then your project will link correctly and will run.

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!

 
LVL 32

Author Comment

by:Batalf
ID: 2540665
Adjusted points to 150
0
 
LVL 32

Author Comment

by:Batalf
ID: 2540666
Hi

Thanks for fast reply.

Now, I have tried making a "dummy"-project. I start up with just one "cpp-file", and there I typed in this simple code :

#include <fstream.h>
void main(void)
{
      cout << "Hei" ;
}

I compiled it and everything was working ok, but when I run it, it just give me a blink and that's it.

What could be wrong.

0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 2542119
Yes, it is finished very quickly and then closed. You can set a break point on the closing brace or main's return. Or add a input request for the user
#inlcude <iostream.h>
int main() // ANSI demands main() to return an int
{
   cout << "Hei" << endl;

   int i;
   cin >> i; // cause the program to wait for input
 
   // alternatively you can set a breakpoint on the return statement
   return 0;
}
0
 
LVL 32

Author Comment

by:Batalf
ID: 2542134
To Kangaroo

I've tried your suggestion too, but nothing happens.

Could it have something to do about what kind of Project I choose :
   Platform : Win32 and
   Target Model : GUI

Maybe that's what wrong?

Regards
Batalf
0
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 2542325
>>Target Model : GUI
change  Target Model to EasyWin (or Concole) and you code will work.


0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 2542339
Ah, off course. You can not use console related IO from a GUI app (I should have thought of that). Try creating a console app like Alex suggests.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

670 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