Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Am trying to use the Visual Studio Express 2010 C++ compiler without using the IDE. I found cl.exe in C:Program Files (x86)Microsoft Visual Studio 10.0VCin. However am having a few difficulties. Firstly it gave me a warning pop up when i type cl saying 'Program cannot start because mspdb100.dll is missing from your computer.'

So i add C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDE to the system path and then try again, but this time:

fatal error C1510: Cannot load language resource clui.dll.

Any idea how to solve this so i can compile? Also how would i set up the path so i can just type 'cl main.cpp' etc, from within a solution folder that does not contain cl.exe. At the moment i have to be inside bin folder. Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
453 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try starting the Visual Studio Command Prompt from

Start->
    All Programs ->
        Microsoft Visual Studio 2010 ->
            Visual Studio Tools ->
                Visual Studio Command Prompt 2010

Alternatively, you can set up the environment by running this in a command prompt:

"c:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat" x86

(note: this will leave your environment set up after running.)

(note2: change x86 as desired. options are x86, ia64, amd64, x86_amd64, x86_ia64)

From there you can run cl.exe. If you want this to be automatically done and undone whenever you run cl, create a batch file with this content:

@echo off
%comspec% /c ""c:Program Files (x86)Microsoft Visual Studio 10.0VCvcvarsall.bat" x86 && cl.exe %*"

(the /c tells the command prompt to end the session after running this command, so your environment returns to normal.)

From there, name it cl.bat. Put this in a folder somewhere, and add the path to that folder to your PATH environment variable, making sure it comes before the path to cl.exe, so that this cl.bat is executed whenever you type cl instead of cl.exe

I recommend you just put cl.bat in your system32/ folder, it should come before cl.exe's path on a default installation.

Alternatively, you can add it in any order and always type cl.bat, or name it something else so there's no confusion.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...