1

I am trying to compile a C++ file from the command line using:

C:\"Program Files (x86)"\"Microsoft Visual Studio 10.0"\VC\bin\x86_amd64\CL /FAcs C:\Users\X\Documents\"Visual Studio 2010"\Projects\"Project File"\My_Project\HELLO.CPP

but I get the error:

The program can't start because mspdb100.dll is missing from your computer. Try reinstalling the program to fix this problem.

I must be making the wrong command line call. Could someone please help?

EDIT I am going to be calling this from a C# app, creating a Process object and then executing. Is there a way I can ensure all variables are set, from the C# app/executing another .bat script from the C# code?

1
  • 1
    Check your machine. Make sure that mspdb100.dll is on your environment PATH. Commented Dec 20, 2012 at 22:22

3 Answers 3

4

In the compiler installation, find the batch file named vsvars32.bat. Run it. Problem solved. (Sorry, no details on exactly where it's located; I'm not at my Windows machine right now)

Sign up to request clarification or add additional context in comments.

4 Comments

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools
@mezamorphic did you run it in the cmd you're using, or did you just double-click it?
Sorry, that was a bit vague. Run it from the command prompt. It sets environment variables that the compiler uses to find its pieces.
cd to the folder where the file lives, and from the command prompt, type its name (without the extension): C:>vsvars32
3

It's not the command line, but the fact that when you startup MSVS, it also sets some environment variables and paths to binaries it needs.

Start the command prompt from the MSVS startup group - that should already have the correct paths set.

2 Comments

-1; editing the PATH is a dangerous route to go, and there are actually several dlls that must be added to make compilation from the command line work. I'm not sure what you mean by "MSVS startup group," but if you mean using the MSVS-specific command prompt, that's preferable.
Well, given that that's my recommended solution as well, I'll remove the downvote.
1

You can either use Pete Becker's solution of running vsvars32.bat (in the command prompt you're using to compile), or you can use the MSVS command prompt, which has all its variables pre-set.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.