954,504 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Cant compile single c++ file

I have one *.cpp file but I cant it compile with MS VC++ ! How to compile signle .cpp file in VC++? Please help me!

StephanJos
Newbie Poster
9 posts since Oct 2008
Reputation Points: 6
Solved Threads: 0
 

Under "Build", click "Build Solution", or just hit F7.

If there is no "Build" in the menu, then you need to create a project first. Click File->New->Project.

Evan M
Light Poster
42 posts since Sep 2007
Reputation Points: 11
Solved Threads: 5
 

what project if I need single file (consule aplication)

StephanJos
Newbie Poster
9 posts since Oct 2008
Reputation Points: 6
Solved Threads: 0
 

You can work with a single file but it has to be in a project.
Why is that? You probably ask. Well you might add some other files later(resources, databasefiles, etc.) if you stay with one file OK, but it's handy if you have more files to keep them in one project.

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

What project I need to create for simple c++ consule program?

StephanJos
Newbie Poster
9 posts since Oct 2008
Reputation Points: 6
Solved Threads: 0
 

Select the "File" menu and select "New Project...".
A window opens.
Under the many options select Console Application.

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

Win32 Console Application.

Evan M
Light Poster
42 posts since Sep 2007
Reputation Points: 11
Solved Threads: 5
 

I created project but it shows:
->header files:
stdafx.h
targetver.h
->Source files:
stdafx.cpp
test2.cpp


Why so many files in project if I need compile 1 file and I dont need that files.. And I donkt know where to write my code in that stupid project..How can then I compile :(

StephanJos
Newbie Poster
9 posts since Oct 2008
Reputation Points: 6
Solved Threads: 0
 

After creating the Win32 Console Application project, there should be a window that says "Win32 Application Wizard". Click "next" and click the "Empty Project" checkbox.

Evan M
Light Poster
42 posts since Sep 2007
Reputation Points: 11
Solved Threads: 5
 

Thank you!

StephanJos
Newbie Poster
9 posts since Oct 2008
Reputation Points: 6
Solved Threads: 0
 

3 years before I used Borland C++ compiler and their editor to and I didn't have to make new project to compile. I just opened I single Cpp file and click Compile and than Run and everything was OK . I'm interested to, to know how to compile a single .cpp file without making new project in Visual Studio probably it is possible.

tonief
Newbie Poster
19 posts since Sep 2008
Reputation Points: 8
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You