Editplus+visualstudio Configuration VC Simple development environment environment

Source: Internet
Author: User

? ? for C + + development, I think that under Windows Everyone uses the most should be Ms VC + +. But its powerful features behind the "slow start", "resource-intensive" shortcomings, especially the later version of VS, the speed is not generally slow and extremely bloated. Of course, this is also very normal, the fish and bear cake has always been difficult to get. Use this big guy to develop the company's major projects, it is naturally handy to use, but for the general small program, a little "overkill" feeling. However, whether in the work or in peacetime to learn, write a small program, usually as long as a CPP file can test the program is still a regular thing. So every time you open vs to write a small test program, but also to build a project, it is a little "luxury". The following is an example of visual studio2012, combining the power of EditPlus to build a simple development environment. (Note that the vs2012 corresponds to the VC11, as you can see from your installation file)

editplus can be configured with a variety of compiled development environments, and support a variety of language syntax highlighting, if you add a compilation function, it is very suitable for my needs in the EditPlus "Configure user Tools" In this setting:
menu text: Visual C + +
Command: "D:/program Files/microsoft Visual Studio 11/vc/bin/cl.exe "???? Here is the specific installation environment
parameter: $ (FilePath)
Initial directory: $ (filedir)
Capture output: On
But no matter what the tune, there is no output. Looked for a long while finally found VC11 and VC6 different, to use it must first use%vs110comntools%vsvars32.bat This batch file set up the environment. That is, the batch should be executed before each compilation. d:\program Files\Microsoft Visual Studio 11.0\vc\bin

My solution is to write another cl.bat to simulate cl.exe,editplus to use this batch command, and this command will first call%vs110comntools%vsvars32.bat set up the environment , Then call Cl.exe to perform the compilation. As follows:

echo off
call "%vs110comntools%vsvars32.bat" ?//The %vs110comntools Here is actually your installed VS environment variable, What if it is vs2012?? D:\Program Files\microso????????????????????????????????? FT Visual Studio one. 0\common7\tools\ (to environment variable view) if not, add or change to an absolute path
if"%1" = = ""goto Usage
cl.exe "%1"
goto : EOF

: Usage
Echo:
echo Error using Cl.bat. The correct usage is:
echo???? %0 Filename
Echo:
echo For example:
echo???? %0 c:/example.cpp
goto : EOF

Save the above to a Cl.bat file, with cl.exe in the same directory (can be arbitrarily placed here to maintain consistency), in EditPlus set the tool to:
Menu Text: C + + compilation
Command: "D:/program files/microsoft Visual Studio 11/vc/bin/cl.bat"
Parameter: "$ (FilePath)"
Initial directory: $ (FILEDIR)
Capture output: Open

K

?

Now try to create a new C + + file, save, compile, everything goes well!

How do you want to be able to execute through editplus after compilation, and then add a tool item:

Menu Text: C + + Run
Command: $ (filenamenoext)
Parameters:
Initial directory: $ (FILEDIR)

?


Now execute the "C + + Run" command, the console window appears "Hello, world!", so that a lightweight C + + compilation environment is configured.

If the user suspects that every time the source files are compiled in a running trouble, use Batch to execute the above two commands and add the following parameters

Menu Text: C compile + Run
Command: D:\Program Files\Microsoft Visual Studio 11.0\vc\bin\clr.bat
Parameter: "$ (Filenamenoext)"
Initial directory: $ (FILEDIR)

Here "action" I chose "capture Output", then the results are displayed in the lower part of the EditPlus interface

?

?

The contents of the Clr.bat file are

echo off

call "%vs110comntools%vsvars32.bat"

if exist %1. C cl.exe %1. C

if exist %1. cpp cl.exe %1. cpp

CLS

%1. exe

goto : EOF

About settings for environment variables:

?

Method 1. Run the script vsvars32.bat:
D:\Program Files (x86) \microsoft Visual Studio 11.0\common7\tools\vsvars32.bat

This batch process is mainly to run cmd at the time to set the environment variables (temporary) (this script is written in the bin, lib,include, tools, the path information, we use this method, can also be configured on their own)


Method 2. Set the system environment variables:
Computer Right-click Property--< Advanced environment variable--< system environment variable Select Path Edit, and then copy the following additions:
;D: \program Files (x86) \microsoft Visual Studio 11.0\common7\ide;d:\program Files (x86) \microsoft Visual Studio 11.0\ Common7\tools;d:\program files (x86) \microsoft Visual Studio 11.0\vc\bin;d:\program Files (x86) \microsoft Visual Studio 11.0\vc\vcpackages; C:\Windows\Microsoft.NET\Framework64\v4.0.30319; C:\Windows\Microsoft.NET\Framework64\v3.5; C:\Windows\Microsoft.NET\Framework\v4.0.30319; C:\Windows\Microsoft.NET\Framework\v3.5;

Microsoft: How to Set environment variables
Http://technet.microsoft.com/zh-cn/library/1700bbwd.aspx

?

?

Editplus+visualstudio Configuration VC Simple development environment environment

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.