Snake_122

I am new with MS Visual Studio, a beginer if you will, I hope somebody can help me with this problem, I need to know how to make regular c++ without the visual part, code into an EXE file


Re: Visual C++ General How do I compile c++ code into a EXE file

Bite Qiu - MSFT

you mean compile your code without IDE if so, you can use CL.exe located in "C:\Program Files\Microsoft Visual Studio 8\VC\bin\". the usage of cl.exe is like: cl [ option... ] filename... [ /link linkoption... ].




Re: Visual C++ General How do I compile c++ code into a EXE file

Dav? S. A???????

It sort of sounds like he wants to compile console code...





Re: Visual C++ General How do I compile c++ code into a EXE file

Simple Samples

There is a lot in Getting Started with Visual Studio that can help you. Be sure to read Tour of the Integrated Development Environment. Then read Walkthrough: Using the Visual Studio IDE. There is much more to learn; one topic that is especially worthwhile is How to: Create Solutions and Projects.






Re: Visual C++ General How do I compile c++ code into a EXE file

einaros

Snake_122 wrote:
I am new with MS Visual Studio, a beginer if you will, I hope somebody can help me with this problem, I need to know how to make regular c++ without the visual part, code into an EXE file

You should have a batch file such as "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat", which initializes all environment variables you need to compile your source file(s) such as Bite Qiu proposes.






Re: Visual C++ General How do I compile c++ code into a EXE file

Simple Samples

einaros wrote:
You should have a batch file such as "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat", which initializes all environment variables you need to compile your source file(s) such as Bite Qiu proposes.
Isn't that the old way In VS 2005 I have a "Visual Studio Command Prompt" that apparently executes the vcvars32.bat file.

My guess is that the question is asking how to create a console application rather than how to compile using a command (non-interactively). That is definitely a guess of course.






Re: Visual C++ General How do I compile c++ code into a EXE file

einaros

Simple Samples wrote:

einaros wrote:
You should have a batch file such as "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat", which initializes all environment variables you need to compile your source file(s) such as Bite Qiu proposes.
Isn't that the old way In VS 2005 I have a "Visual Studio Command Prompt" that apparently executes the vcvars32.bat file.

My guess is that the question is asking how to create a console application rather than how to compile using a command (non-interactively). That is definitely a guess of course.

The VS command prompt shortcut should start the vcvarsall batch file, with a parameter indicating which platform the environment should be adjusted for. Instead of attempting to guide the OP to find the shortcut (which may or may not have been installed for all I know), I'd rather just show him the batch file.

You are probably right about the gui. I read Bite Qiu and Dave's posts and figured I'd expand on those.

It sure is lovely that we get to spam another post with such arguments, though.






Re: Visual C++ General How do I compile c++ code into a EXE file

RobGrainger

If you are just trying to make a command-line program using traditional C++, rather than a Windows application, under the IDE then all you need to is create a new project (File menu), and, under the C++ options, select "C++ Console Application".

By default, this will create a new project with boiler plate code for a "main" function. That will be a good starting point.

If you have existing code you want to try and compile, follow the same route, but in the Wizard dialogs select to create an empty project - this will have no boilerplate code. You can then use the Solution Explorer to add files (right-click on the project name) to the project.

Options to compile the project into an EXE are available under the "Project" menu. "Build All" will build all the files in the current project. This will result in an .exe in the "Debug" subdirectory of your project (if you're compiling a debug build - the default).

Hope this helps.