Delirium tremens
Delirium tremens

Reputation: 4739

compiling a small C++ program with Visual C++ Express

I opened hello.cpp. Why isn't there File -> Compile -> hello.cpp? What is an other easy way, if any?

Upvotes: 1

Views: 338

Answers (3)

user865927
user865927

Reputation:

Or, you could use something like notepad++ and write a script that compiles with the windows 7/Visual studio C++ compile (CL.exe). That could work as well and do what you describe. C++ was meant for medium and large size projects that require performance and space efficiency. If you want to practice you could use the method I described but otherwise I'd recommend using something like Python/Java/PHP/etc to crank out applications that can take the performance hit of an interpreted/JIT compiled language. This will allow you to develop at a rapid pace. I prefer C++ myself but I use the approach very frequently.

Upvotes: 1

Tim Sylvester
Tim Sylvester

Reputation: 23138

The file must be part of a project before you can compile/build it. Starting with VS 2005 (or maybe 2008), you can use File -> New -> Project From Existing Code to wrap a project around source files.

Upvotes: 2

Daniel A. White
Daniel A. White

Reputation: 190945

The best way its to create an empty project add your hello.cpp then Visual Studio will build your program.

Upvotes: 0

Related Questions