error PRJ0003 : 生成“cl.exe”时出错 解决方案

本人已经安装了VS2010,但是同事给的项目是用VC2008写的,用到几个lib文件,路径也都正确,但就是无法正确解析,所以我怀疑是lib库生成的环境问题。所以考虑装个VC2008。但是我又不敢直接安装VS2008,怕破坏VS2010的环境,所以在网上找了个VC2008绿色精简版的包,下载地址:http://d1.amobbs.com/bbs_upload782111/files_50/ourdev_710509KTJTYR.rar,下载后根据说明进行安装,修改了必要的路径后,一切都很顺利。


但是编译程序出现标题中那种错误,真是莫名其妙。后来写了个Hello world程序,发现还是一样的问题。找来找去,摸索了很久,最终发现几个环境变量有问题,导致无法正确找到编译器及include目录等。


参考了下vc2010的安装目录,发现下载的这个包解压后的目录结构存在问题,难怪安装后不行。


调整目录结构,将以下目录移动到VC目录下:atlmfc、bin、crt、include、lib、redist,调整后的目录结构为:

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

经过以上调整后,再安装VC2008,编译Hello world成功。后来又建立了一个基于对话框的MFC程序,又出了问题。。。。。。


总之一句话,只要好好设置各个include, lib等目录,相信一定可以解决问题的!我就是那样解决的!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/404403.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

[react] 简要描述下你知道的react工作原理是什么?

[react] 简要描述下你知道的react工作原理是什么? 我理解的核心部分: 通过虚拟DOM表达真实DOM通过数据驱动更新虚拟DOM进而更新真实DOM(MVVM)有一套完整并且合理的 DOM Diff 算法(现在 React 17 是基于 lane 架构来调…

Bitmap 之 getPixels() 的 stride

学习Graphics中遇到位图(Bitmap)中getPixels()方法,对该方法的用法大体理解,但对其中的stride参数却不明白具体的用法以及用意,现记述过程如下: getPixels()方法的用处为获取位图(Bitmap)中的像素值(颜色值),存入类型为…

i++ 和 ++i 效率的分析以及自定义类型的自增/自减运算符重载实例

From: http://blog.csdn.net/leo115/article/details/8101541 我们通常在写for循环 的时候,要实现变量 i 的自增 1 ;往往会在i 和i中随便挑一种写,对于i和i的理解,我们往往停留在返回的值的不同,其实i与i在实现效率上…

day②:字典的fromkeys方法

start##fromkeys方法本身就是把所有的key都指向同一个对象了>>> cdict.fromkeys(range(5),[]) >>> c{0: [], 1: [], 2: [], 3: [], 4: []}>>> c[0].append({"B":{123}})>>> c{0: [{B: set([123])}], 1: [{B: se…

[react-router] React-Router的实现原理是什么?

[react-router] React-Router的实现原理是什么? 1.react-router依赖基础 - history,是一个独立的第三方js库,可以用来兼容在不同浏览器、不同环境下对历史记录的管理,拥有统一的API。具体来说里面的history分为三类: HashRouter…

Linux Bash Shell入门教程

BASH 的基本语法 最简单的例子 —— Hello World! 关于输入、输出和错误输出 BASH 中对变量的规定(与 C 语言的异同) BASH 中的基本流程控制语法 函数的使用 2.1 最简单的例子 —— Hello World! 几乎所有的讲解编程的书给读者的第一个例子都是…

[react] 请描述下事件在react中的处理方式是什么?

[react] 请描述下事件在react中的处理方式是什么? 所有时间都挂载到 document 上,然后捕获对应的 dom。 类似事件委托 个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录…

BZOJ 1146: [CTSC2008]网络管理Network( 树链剖分 + 树状数组套主席树 )

树链剖分完就成了一道主席树裸题了, 每次树链剖分找出相应区间然后用BIT(可持久化)权值线段树就可以完成计数. 但是空间问题很严重....在修改时不必要的就不要新建, 直接修改原来的..详见代码. 时间复杂度O(N*log^3(N))------------------------------------------------------…

标准RTSP 消息的错误代码

From: http://blog.csdn.net/ameyume/article/details/7441060 标准RTSP消息的错误代码–在应答消息的第一行表示 ”100” ; Continue (all 100 range) “110”; Connect Timeout “200” ; OK ”201” ; Created ”250” ; Low on Storage Space ”300” ; Multiple Choic…

[react-router] React-Router怎么设置重定向?

[react-router] React-Router怎么设置重定向? 采用 Redirect 进行重定向 个人简介 我是歌谣,欢迎和大家一起交流前后端知识。放弃很容易, 但坚持一定很酷。欢迎大家一起讨论 主目录 与歌谣一起通关前端面试题

struts2遍历select

2019独角兽企业重金招聘Python工程师标准>>> <s:bean name"org.apache.struts2.util.Counter" id"counter"> <s:param name"first" value"1" /> <s:param name"last" value"pageCount"…

[建议]我对软工有话说(上)

我对软工有话说 经历了一学期的软件工程课程实践&#xff0c;先给个自己在这门课中学到的东西打个分&#xff1a; 编码能力&#xff1a;★★★代码质量&#xff1a;★★★★团队管理&#xff1a;★★★★★风险控制&#xff1a;★★★★解决问题的能力&#xff1a;★★★★★下…

[react-router] React-Router的路由有几种模式?

[react-router] React-Router的路由有几种模式&#xff1f; 1、BrowserRouter&#xff1a;浏览器的路由方式&#xff0c;也就是在开发中最常使用的路由方式 2、HashRouter&#xff1a;在路径前加入#号成为一个哈希值&#xff0c;Hash模式的好处是&#xff0c;再也不会因为我们…

Spring MVC X-Frame-Options

https://docs.spring.io/spring-security/site/docs/current/reference/html/headers.html#headers-frame-options 转载于:https://www.cnblogs.com/heshuai/p/5132141.html

[react] react组件间的通信有哪些?

[react] react组件间的通信有哪些&#xff1f; PropsContextref&#xff1a;通过Ref获取组建的实例&#xff0c;在通过实例拿到组件的属性值或者方法的回调 第三方的&#xff0c;Redux是基于Conext基础上的库&#xff0c;Mobx这是依赖收集&#xff0c;EventBus是发布订阅模式&…

Fedora开机自动登录指定用户(root或普通用户)

From: http://www.360doc.com/content/12/0709/11/6828497_223143657.shtml 2010-07-19 12:53:04| 分类&#xff1a;Linux学习 | 标签&#xff1a;|字号大中小 订阅 自从Fedora 10开始&#xff0c;以后版本默认均无法在GUI下界面以root账号登录。其实这个设计是比较好的&…

android中心类库

android开发过程中总会用到各种各样的类库&#xff0c;也即jar包&#xff0c;以下地址可以满足您的需求 地址&#xff1a;http://search.maven.org/转载于:https://www.cnblogs.com/kangweifeng/p/5133233.html

[react-router] 在history模式中push和replace有什么区别?

[react-router] 在history模式中push和replace有什么区别&#xff1f; push()&#xff1a;添加一个新的记录到历史堆栈, history.length1。&#xff08;一般会用来跳转到一个新页面, 用户点击浏览器的回退按钮可以回到之前的路径。&#xff09; replace()&#xff1a;替换掉当…

Web安全开发注意事项

1.sql注入&#xff1a;这个很常规了&#xff0c;不要拼字符串以及过滤关键字都可以防住&#xff0c;需要注意的是&#xff0c;Cookie提交的参数也是可以导致注入漏洞的。 2.旁注&#xff1a;就是说在保证自己的程序没问题的同时&#xff0c;也要保证同台服务器的其他站点没问题…

[react-router] React-Router 4怎样在路由变化时重新渲染同一个组件?

[react-router] React-Router 4怎样在路由变化时重新渲染同一个组件&#xff1f; 1.在同一个组件添加不同的key,以下重新封装了组件&#xff1a; export default function (props) {return (<组件 {...props} key{search参数} />) }2.但是不知道在路由跳转的地方加入ke…