DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   C++ (http://www.daniweb.com/forums/forum8.html)
-   -   Cant compile single c++ file (http://www.daniweb.com/forums/thread153316.html)

StephanJos Oct 24th, 2008 2:05 pm
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!

Evan M Oct 24th, 2008 2:38 pm
Re: Cant compile single c++ file
 
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.

StephanJos Oct 24th, 2008 2:53 pm
Re: Cant compile single c++ file
 
what project if I need single file (consule aplication)

ddanbe Oct 24th, 2008 3:00 pm
Re: Cant compile single c++ file
 
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.

StephanJos Oct 24th, 2008 3:04 pm
Re: Cant compile single c++ file
 
What project I need to create for simple c++ consule program?

ddanbe Oct 24th, 2008 3:09 pm
Re: Cant compile single c++ file
 
Select the "File" menu and select "New Project...".
A window opens.
Under the many options select Console Application.

Evan M Oct 24th, 2008 3:11 pm
Re: Cant compile single c++ file
 
Win32 Console Application.

StephanJos Oct 24th, 2008 3:27 pm
Re: Cant compile single c++ file
 
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 :(

Evan M Oct 24th, 2008 3:31 pm
Re: Cant compile single c++ file
 
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.

StephanJos Oct 24th, 2008 3:40 pm
Re: Cant compile single c++ file
 
Thank you!


All times are GMT -4. The time now is 1:28 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC