生活随笔
收集整理的這篇文章主要介紹了
                                
error PRJ0003 : 生成“cl.exe”时出错 解决方案
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.                        
 
                                
                            
                            
                            本人已經(jīng)安裝了VS2010,但是同事給的項目是用VC2008寫的,用到幾個lib文件,路徑也都正確,但就是無法正確解析,所以我懷疑是lib庫生成的環(huán)境問題。所以考慮裝個VC2008。但是我又不敢直接安裝VS2008,怕破壞VS2010的環(huán)境,所以在網(wǎng)上找了個VC2008綠色精簡版的包,下載地址:http://d1.amobbs.com/bbs_upload782111/files_50/ourdev_710509KTJTYR.rar,下載后根據(jù)說明進(jìn)行安裝,修改了必要的路徑后,一切都很順利。
 
 
 
但是編譯程序出現(xiàn)標(biāo)題中那種錯誤,真是莫名其妙。后來寫了個Hello world程序,發(fā)現(xiàn)還是一樣的問題。找來找去,摸索了很久,最終發(fā)現(xiàn)幾個環(huán)境變量有問題,導(dǎo)致無法正確找到編譯器及include目錄等。
 
 
 
參考了下vc2010的安裝目錄,發(fā)現(xiàn)下載的這個包解壓后的目錄結(jié)構(gòu)存在問題,難怪安裝后不行。
 
 
 
調(diào)整目錄結(jié)構(gòu),將以下目錄移動到VC目錄下:atlmfc、bin、crt、include、lib、redist,調(diào)整后的目錄結(jié)構(gòu)為: 
 
 
 
D:\MICROSOFT\VC2008
├─Common7
│  ├─IDE
│  │  ├─2052
│  │  ├─ExceptionAssistantContent
│  │  │  └─2052
│  │  ├─Extensibility Projects
│  │  │  ├─CSharp
│  │  │  │  └─2052
│  │  │  ├─csharp-shared
│  │  │  ├─MCpp
│  │  │  │  └─2052
│  │  │  ├─VBasic
│  │  │  │  └─2052
│  │  │  ├─vbasic-shared
│  │  │  ├─VCATL
│  │  │  │  └─2052
│  │  │  └─vcatl-shared
│  │  ├─ItemTemplatesCache
│  │  ├─MacroProjectItems
│  │  ├─MacroProjects
│  │  ├─NewFileItems
│  │  ├─NewScriptItems
│  │  ├─PrivateAssemblies
│  │  │  ├─1033
│  │  │  ├─2052
│  │  │  └─zh-CHS
│  │  ├─Profiles
│  │  ├─ProjectTemplatesCache
│  │  ├─PublicAssemblies
│  │  │  ├─zh-CHS
│  │  │  └─zh-CN
│  │  ├─SolutionTemplates
│  │  ├─Themes
│  │  ├─VS SCC
│  │  │  └─2052
│  │  ├─Xml
│  │  │  ├─2052
│  │  │  └─zh-CHS
│  │  ├─zh-CHS
│  │  └─zh-CN
│  ├─Packages
│  │  ├─1033
│  │  │  └─schemas
│  │  ├─2052
│  │  │  └─schemas
│  │  │      └─CSS
│  │  ├─Debugger
│  │  │  ├─2052
│  │  │  ├─Visualizers
│  │  │  │  ├─Original
│  │  │  │  └─zh-CHS
│  │  │  └─x86
│  │  └─schemas
│  │      ├─html
│  │      └─xml
│  │          └─2052
│  └─Tools
│      ├─2052
│      ├─Deployment
│      │  ├─2052
│      │  ├─VsdDialogs
│      │  │  ├─0
│      │  │  ├─1028
│      │  │  ├─1031
│      │  │  ├─1033
│      │  │  ├─1036
│      │  │  ├─1040
│      │  │  ├─1041
│      │  │  ├─1042
│      │  │  ├─1046
│      │  │  ├─1049
│      │  │  ├─2052
│      │  │  └─3082
│      │  ├─VsdProjects
│      │  ├─VsdSchema
│      │  └─Vspkgs
│      │      └─2052
│      ├─Templates
│      │  ├─Database Project Items
│      │  └─Database Projects
│      └─VDT
│          └─2052
├─PlatformSDK
│  ├─Include
│  │  └─gl
│  └─Lib
├─ReportViewer
│  ├─zh-CHS
│  └─zh-CN
├─SDK
│  └─V6.0A
│      ├─bin
│      │  ├─en-us
│      │  ├─msitools
│      │  │  ├─Schemas
│      │  │  │  └─MSI
│      │  │  │      ├─100
│      │  │  │      ├─110
│      │  │  │      ├─120
│      │  │  │      └─intl
│      │  │  └─Templates
│      │  │      └─MSI
│      │  ├─vsstools
│      │  └─zh-CHS
│      └─Bootstrapper
│          ├─Engine
│          │  ├─de
│          │  ├─en
│          │  ├─es
│          │  ├─fr
│          │  ├─it
│          │  ├─ja
│          │  ├─ko
│          │  ├─pt-BR
│          │  ├─ru
│          │  ├─zh-CHS
│          │  └─zh-CHT
│          ├─Packages
│          │  ├─DotNetFX
│          │  │  └─zh-CHS
│          │  ├─DotNetFX30
│          │  │  └─zh-CHS
│          │  ├─DotNetFX35
│          │  │  └─zh-CHS
│          │  ├─ReportViewer
│          │  │  └─zh-CHS
│          │  ├─SqlExpress
│          │  │  └─zh-CHS
│          │  ├─VBPowerPacks
│          │  │  └─zh-CHS
│          │  ├─vcredist_x64
│          │  │  └─zh-CHS
│          │  ├─vcredist_x86
│          │  │  └─zh-CHS
│          │  ├─VSTOR30
│          │  │  └─zh-chs
│          │  └─WindowsInstaller3_1
│          │      └─zh-CHS
│          └─Schemas
├─System
│  ├─assembly
│  ├─Common Files
│  │  ├─CAPICOM
│  │  ├─Designer
│  │  ├─Merge Modules
│  │  ├─MSDesigners8
│  │  │  └─Resources
│  │  │      └─2052
│  │  ├─MSEnv
│  │  │  ├─2052
│  │  │  ├─PublicAssemblies
│  │  │  │  └─zh-CN
│  │  │  └─zh-CHS
│  │  ├─MSI Tools
│  │  ├─SQL Debugging
│  │  ├─Visual Database Tools
│  │  ├─VS7Debug
│  │  │  └─2052
│  │  ├─VSA
│  │  │  └─9.0
│  │  │      ├─Common
│  │  │      │  ├─2052
│  │  │      │  └─VSAProjectItems
│  │  │      │      └─Project Items
│  │  │      └─VsaEnv
│  │  │          ├─2052
│  │  │          ├─Packages
│  │  │          │  ├─2052
│  │  │          │  └─Debugger
│  │  │          │      └─2052
│  │  │          ├─SolutionTemplates
│  │  │          └─zh-CHS
│  │  ├─VsDeploy
│  │  └─WMI
│  ├─symbols
│  │  └─dll
│  └─System32
│      └─2052
├─VC
│  ├─atlmfc
│  │  ├─include
│  │  │  ├─l.chs
│  │  │  ├─l.cht
│  │  │  └─res
│  │  ├─lib
│  │  └─src
│  │      ├─atl
│  │      │  └─atls
│  │      │      └─INTEL
│  │      ├─mfc
│  │      │  ├─intel
│  │      │  ├─l.chs
│  │      │  └─l.cht
│  │      └─mfcm
│  │          ├─INTEL
│  │          └─interfaces
│  ├─bin
│  │  ├─2052
│  │  └─zh-CHS
│  ├─crt
│  │  └─src
│  │      ├─cliext
│  │      ├─intel
│  │      │  ├─dll_lib
│  │      │  │  ├─clr_obj
│  │      │  │  └─pure_obj
│  │      │  ├─mt_lib
│  │      │  ├─xdll_lib
│  │      │  │  ├─clr_obj
│  │      │  │  └─pure_obj
│  │      │  └─xmt_lib
│  │      ├─msclr
│  │      │  └─com
│  │      └─sys
│  ├─include
│  │  ├─cliext
│  │  ├─CodeAnalysis
│  │  ├─msclr
│  │  │  └─com
│  │  └─sys
│  ├─lib
│  ├─redist
│  │  ├─Debug_NonRedist
│  │  │  └─x86
│  │  │      ├─Microsoft.VC90.DebugCRT
│  │  │      ├─Microsoft.VC90.DebugMFC
│  │  │      └─Microsoft.VC90.DebugOpenMP
│  │  └─x86
│  │      ├─Microsoft.VC90.ATL
│  │      ├─Microsoft.VC90.CRT
│  │      ├─Microsoft.VC90.MFC
│  │      ├─Microsoft.VC90.MFCLOC
│  │      └─Microsoft.VC90.OPENMP
│  ├─VCAddClass
│  │  ├─ATL
│  │  │  └─WMI
│  │  ├─Generic
│  │  ├─MFC
│  │  └─VCNet
│  ├─VCContextItems
│  ├─VCNewItems
│  ├─VcPackages
│  │  └─2052
│  ├─VCProjectDefaults
│  ├─VcProjectitems
│  │  ├─Code
│  │  ├─Data
│  │  ├─PropertySheets
│  │  ├─Resource
│  │  ├─UI
│  │  ├─Utility
│  │  └─Web
│  ├─VcProjects
│  │  ├─ATL
│  │  ├─General
│  │  ├─MFC
│  │  ├─vcNET
│  │  └─Win32
│  ├─VCResourceTemplates
│  │  └─2052
│  └─VCWizards
│      ├─1033
│      │  └─Images
│      ├─2052
│      ├─AppWiz
│      │  ├─.NET
│      │  │  ├─ClassLibrary
│      │  │  │  ├─Scripts
│      │  │  │  │  └─2052
│      │  │  │  └─Templates
│      │  │  │      └─2052
│      │  │  ├─Console
│      │  │  │  ├─Scripts
│      │  │  │  │  └─2052
│      │  │  │  └─Templates
│      │  │  │      └─2052
│      │  │  ├─ControlLibrary
│      │  │  │  ├─scripts
│      │  │  │  │  └─2052
│      │  │  │  └─templates
│      │  │  │      └─2052
│      │  │  ├─EmptyProject
│      │  │  │  └─Scripts
│      │  │  │      └─2052
│      │  │  ├─WinForm
│      │  │  │  ├─scripts
│      │  │  │  │  └─2052
│      │  │  │  └─templates
│      │  │  │      └─2052
│      │  │  └─WinService
│      │  │      ├─scripts
│      │  │      │  └─2052
│      │  │      └─templates
│      │  │          └─2052
│      │  ├─ATL
│      │  │  └─ATLProject
│      │  │      ├─html
│      │  │      │  └─2052
│      │  │      ├─Images
│      │  │      ├─scripts
│      │  │      │  └─2052
│      │  │      └─templates
│      │  │          └─2052
│      │  ├─Generic
│      │  │  ├─Application
│      │  │  │  ├─html
│      │  │  │  │  └─2052
│      │  │  │  ├─images
│      │  │  │  ├─scripts
│      │  │  │  │  └─2052
│      │  │  │  └─templates
│      │  │  │      └─2052
│      │  │  ├─CustomWizard
│      │  │  │  ├─HTML
│      │  │  │  │  └─2052
│      │  │  │  ├─Images
│      │  │  │  ├─Scripts
│      │  │  │  │  └─2052
│      │  │  │  └─Templates
│      │  │  │      └─2052
│      │  │  └─MakefileProject
│      │  │      ├─HTML
│      │  │      │  └─2052
│      │  │      ├─Images
│      │  │      ├─Scripts
│      │  │      │  └─2052
│      │  │      └─Templates
│      │  │          └─2052
│      │  └─MFC
│      │      ├─Application
│      │      │  ├─html
│      │      │  │  └─2052
│      │      │  ├─images
│      │      │  ├─scripts
│      │      │  │  └─2052
│      │      │  └─templates
│      │      │      ├─1028
│      │      │      ├─1031
│      │      │      ├─1033
│      │      │      ├─1036
│      │      │      ├─1040
│      │      │      ├─1041
│      │      │      ├─1042
│      │      │      ├─2052
│      │      │      └─3082
│      │      ├─Control
│      │      │  ├─html
│      │      │  │  └─2052
│      │      │  ├─images
│      │      │  ├─scripts
│      │      │  │  └─2052
│      │      │  └─templates
│      │      │      └─2052
│      │      └─Library
│      │          ├─html
│      │          │  └─2052
│      │          ├─Images
│      │          ├─scripts
│      │          │  └─2052
│      │          └─templates
│      │              └─2052
│      └─CodeWiz
│          ├─.NET
│          │  ├─Component
│          │  │  ├─scripts
│          │  │  │  └─2052
│          │  │  └─templates
│          │  │      └─2052
│          │  ├─Installer
│          │  │  ├─scripts
│          │  │  │  └─2052
│          │  │  └─templates
│          │  │      └─2052
│          │  ├─UserControl
│          │  │  ├─scripts
│          │  │  │  └─2052
│          │  │  └─templates
│          │  │      └─2052
│          │  ├─WinForm
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  └─XMLSchema
│          │      ├─Scripts
│          │      │  └─2052
│          │      └─Templates
│          │          └─2052
│          ├─ATL
│          │  ├─AddToMFC
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─ASP
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Consumer
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Control
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─DLG
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Event
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─ImplementInterface
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Instance
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Method
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  └─Scripts
│          │  │      └─2052
│          │  ├─MTS
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─PPG
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Property
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  └─Scripts
│          │  │      └─2052
│          │  ├─Provider
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─Simple
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  └─SRFFile
│          │      ├─Scripts
│          │      │  └─2052
│          │      └─Templates
│          │          └─2052
│          ├─Generic
│          │  ├─Class
│          │  │  ├─HTML
│          │  │  │  └─2052
│          │  │  ├─Images
│          │  │  └─Scripts
│          │  │      └─2052
│          │  ├─DEFFile
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─PropertySheet
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  ├─RCFile
│          │  │  ├─Scripts
│          │  │  │  └─2052
│          │  │  └─Templates
│          │  │      └─2052
│          │  └─ResourceScript
│          │      ├─scripts
│          │      │  └─2052
│          │      └─Templates
│          │          └─2052
│          └─MFC
│              ├─AxControl
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  ├─Scripts
│              │  │  └─2052
│              │  └─Templates
│              │      └─2052
│              ├─CommandHandler
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  └─Scripts
│              │      └─2052
│              ├─Consumer
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  ├─Scripts
│              │  │  └─2052
│              │  └─Templates
│              │      └─2052
│              ├─Event
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  └─Scripts
│              │      └─2052
│              ├─Function
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  └─Scripts
│              │      └─2052
│              ├─Simple
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  ├─scripts
│              │  │  └─2052
│              │  └─Templates
│              │      └─2052
│              ├─Typelib
│              │  ├─HTML
│              │  │  └─2052
│              │  ├─Images
│              │  ├─Scripts
│              │  │  └─2052
│              │  └─Templates
│              │      └─2052
│              └─Variable
│                  ├─HTML
│                  │  └─2052
│                  ├─Images
│                  ├─Scripts
│                  │  └─2052
│                  └─Templates
│                      └─2052
└─Xml├─2052│  └─Snippets│      ├─xsd│      │  ├─Attributes│      │  ├─ComplexTypes│      │  ├─Elements│      │  ├─Extensions│      │  ├─Misc│      │  └─SimpleTypes│      └─xslt│          ├─html│          └─xslTags└─Schemas└─2052└─MSBuild
 
經(jīng)過以上調(diào)整后,再安裝VC2008,編譯Hello world成功。后來又建立了一個基于對話框的MFC程序,又出了問題。。。。。。
 
 
 
總之一句話,只要好好設(shè)置各個include, lib等目錄,相信一定可以解決問題的!我就是那樣解決的!
 
                            總結(jié)
                            
                                以上是生活随笔為你收集整理的error PRJ0003 : 生成“cl.exe”时出错 解决方案的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
                            
                            
                                如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。