views:

947

answers:

3

PROBLEM:

C:\>**cl /LD hellomodule.c /Ic:\Python24\include c:\Python24\libs\python24.lib /link/out:hello.dll**

'cl' is not recognized as an internal or external command, operable program or batch file.

I am using Visual Studio Prof Edi 2008.

  1. What PATH should I set for this command to work?
  2. How to execute above command using the IDE?

NOTE:I am studying this.


C:\>cl /LD hellomodule.c /Ic:\Python24\include c:\Python24\libs\python24.lib /li
nk/out:hello.dll
'cl' is not recognized as an internal or external command,
operable program or batch file.

C:\>PATH="C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe"

C:\>cl
'cl' is not recognized as an internal or external command,
operable program or batch file.

C:\>PATH="C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe"

C:\>cl /LD hellomodule.c /Ic:\Python24\include c:\Python24\libs\python24.lib /li
nk/out:hello.dll
'cl' is not recognized as an internal or external command,
operable program or batch file.

C:\>


+1  A: 

Can you be a bit more specific with your question? What exactly is not working? Can it not find the program, does the compile fail, etc ...

The only immediate issue I can see is that the command line can't resolve the CL command. Try including the full path to the cl.exe binary. This is the relevant path on my machine.

C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\cl.exe

EDIT

When using the path environment variable, you must set it to a path, not an application. Change your path code to

set PATH=%PATH%;C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

As for the inability to load mspdb80.dll, I'm worried messing with your environment variables may have contributed to this problem. Restart your cmd.exe shell and add the line I specified above and retry. If you still get the error with mspdb80.dll you may need to repair your Visual Studio installation.

EDIT2

Definitely looks like the PATH environment variable is messing up the load path for mspdb80.dll. This thread has a bunch of solutions for this problem

http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/2a3c57c5-de79-43e6-9769-35043f732d68/

JaredPar
I tried this :( but still same error.
TheMachineCharmer
@david, can you post the full command line when you qualify the path?
JaredPar
@JaredPar,yes its up there.
TheMachineCharmer
@JaredPar,and if I try C:\Program Files\Microsoft Visual Studio 9.0\VC\bin>cla message box pops up that says "This application has failed to start because mspdb80.dll was not found.Re-installing the application may fix this problem."
TheMachineCharmer
@JaredPar,I tried PATH="C:\Program Files\Microsoft Visual Studio 9.0\VC\bin\". It pops up a box same as in above comment.
TheMachineCharmer
@JardPar,well .dll problem persists :) . Do I need to re-install or is there any option to repair? Thanks a lot.
TheMachineCharmer
@JarPar,Thanks a lot.(1 up :) )
TheMachineCharmer
+1  A: 

I have a "Visual Studio 2008 Command Prompt" in my Programs menu. Are you using that or the command prompt?

brian chandley
I'm using normal windows command prompt.
TheMachineCharmer
Don't. Use the "Visual Studio 2008 Command Prompt". That's what it's for.
John Saunders
@John,How to start VS8 cmd prmpt? I'm noob.
TheMachineCharmer
+3  A: 

You can set up the environment by using

C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat

cmeerw
@cmeerw,cool you solveed the problem.(1 up:) )
TheMachineCharmer