기본 콘텐츠로 건너뛰기

Fixing the "Error spawning cmd.exe" Error in Visual Studio

When trying to build a C++ project with Visual Studio 2005 Beta 2(or 2007, 2008), I always get a PRJ0003 error:Error spawning 'cmd.exe'
Since I mostly use C# this hasn't been bothering me unduly, particularly since it mainly seems to afflict a custom build action that doesn't appear to be essential for the compilation process... But I finally got around to finding a solution.
The first clue was that if I invoked VCBuild.exe from the command line, I could get rid of the problem by using the /useenv command line option. This tells it to use environment variables to get the path to libraries, executable and the like instead of using the configured directories. The fact that it works when using the environment variables, but not when using the configured directories pointed the finger at the configured directories...
This config can be found in Visual Studio's Options dialog (off the Tools menu). It's in the Projects and Solutions -> VC++ Directories page. This turns out to configure settings used both by VS and also by the command-line VCBuild. (I think VS just launches VCBuild to build your project.)
This options page has a row of buttons on the right hand side. One of these is a tick. Clicking that checks all of the configured items for validity. When I clicked this, it complained about three items:%SystemRoot%\System32
%SystemRoot%
%SystemRoot%\System32\wbem
Those entries look out of place. They're using the %xxx% variable syntax you can use from the command line. But all the other entries use the $(xxx) convention. So I changed the entries to:$(SystemRoot)\System32
$(SystemRoot)
$(SystemRoot)\System32\wbem
I clicked the tick button again, and this time it was happy. And now when I build C++ projects (either from the command line or VS) I no longer get the Error spawning 'cmd.exe' error.

댓글

이 블로그의 인기 게시물

Ubuntu (Kubuntu) 에 desktop 파일 만들기

Package 관리자등을 통해 직접 Repository 에 있는 Application 을 설치하는 경우에는 필요한 경로와 파일, Category 로 분류된 Icon 등록 등이 자동적으로 이루어지나 firefox, eclipse 등 새로운 버전을 새로 설치할 경우, 다음과 같은 절차를 통해 시작메뉴에 등록시킬 수 있다. 다음은 eclipse-SDK-3.6-linuxx-gtk.tar.gz 을 받아 설치 등록하는 것을 예로 든다. 1. 다운받은 파일을 /usr/lib에 압축해제한다. (물론, super user 계정으로 실행해야 한다.) 2. 보통의 경우, /usr/bin Directory 는 PATH 에 물려 있으므로 다음과 같은 실행 파일을 만들어 놓는다. # cd /usr/lib # chmod +x eclipse # cd /usr/bin # sudo nano eclipse eclipse 파일에는 아래의 내용을 입력하여 넣는다. export ECLIPSE_HOME="/usr/lib/eclipse" $ECLIPSE_HOME/eclipse $ * # sudo chmod 755 eclipse 3. Desktop Menu 에 추가하려면 # cd /usr/share/applications # sudo nano eclipse.desktop [Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/usr/lib/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;Application;Development' StartupNotify=true 이렇게 입력한 파일을 저장하면, 시작메뉴 > 개발 > Eclipse 아이콘이 생성되어 메뉴에서 직접 실행할 수 있게된다.

우분투에 연결된 프린터, 스캐너를 윈도우즈에서 공유하여 사용하는 방법

[Sharing Printer and Scanner through Network] 전제조건 ( 사용환경 ) 복합기가 연렬되어 프린터와 스캐너 서비스를 공급할 대상 : Ubuntu 16.10 (Yakkety Yak) 64bit 공유된 프린터와 스캐너를 사용할 대상 : Windows 10 64bit 사용 중인 복합기 : Canon-MX318 (PIXMA MX310 Series) Server-side setup $ sudo apt update $ sudo apt-get install cupsys cupsys-client xinetd $ sudo apt-get install samba smbfs swat $ sudo dpkg-reconfigure xinetd $ sudo apt install cups cups-pdf xsane sane-utils xscanimage gscan2pdf $ sudo adduser saned lp $ sudo gedit / etc/cups/ printers.conf 웹브라우저의 http://snjee-nb2-ubuntu:631 에서 설정된 내용들이 표시된다. $ sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original $ sudo chmod a-w /etc/cups/cupsd.conf.original $ sudo gedit /etc/inetd.conf sane-port stream tcp nowait saned.saned /usr/sbin/saned saned $ sudo touch /etc/xinetd.d/saned $ sudo gedit /etc/xinetd.d/saned service saned { socket...

STM32CubeIDE 한글 주석 깨짐 문제 해결

STM32CubeIDE 는 JAVA로 프로그램된 eClipse CDT 프레임워크 기반으로 제작된 소프트웨어 이다. 아래의 내용은 STM32CubeIDE 개발 환경에서,  시스템 환경을 변경하기 위해  Pinout 등을 수정하여  Device Configuration Tool Code Generation (IOC File) 을 수행하면 수정된 코드가 자동 생성된다. 이 때, 소스 상의 한글 주석이 깨지는 문제점을 해결하는 방법이다. JAVA의 File Encoding 문제이며, 나는 소스파일을 UTF-8로 encoding 하도록 수정하였다. 다음의 순서로 진행한다. 1. 메뉴 Window > Preferences > Workspace - 하단의 Text file encoding을 Other 리스트 중에서 UTF-8을 선택한다. - Apply and Close 한다. 2. 탐색기 > 내 PC > 마우스 우측 클릭 > 팝업 메뉴에서 "속성" > 고급 시스템 설정 - 시스템 속성 창이 뜨면 "고급" 탭 하단의 "환경 변수" 클릭 - 사용자 변수에 "새로 만들기" 버튼을 눌러 변수 이름 : JAVA_TOOL_OPTIONS 변수 값 : -Dfile.encoding=UTF-8