windows 将 Visual Studio 2005 sln 迁移到 2008,在 LIB 环境变量中使用 vc98 路径发出警告,如何修复?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/826921/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Migrating Visual Studio 2005 sln to 2008, warning with vc98 paths in LIB environment variable, how to fix?
提问by Mike Caron
I'm migrating a solution from visual studio 2005 to visual studio 2008. When I build the solution in 2005, I don't have any issues. However, after I use devenv.exe /Upgrade and then use msbuild on the solution, I get the following warnings:
我正在将解决方案从 Visual Studio 2005 迁移到 Visual Studio 2008。当我在 2005 年构建解决方案时,我没有任何问题。但是,在我使用 devenv.exe /Upgrade 然后在解决方案上使用 msbuild 后,我收到以下警告:
CSC : warning CS1668: Invalid search path '\vc98\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified.' CSC : warning CS1668: Invalid search path '\vc98\mfc\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified. ' CSC : warning CS1668: Invalid search path 'c:\program files\microsoft visual studio 9.0\vc\platformsdk\lib' specified in 'LIB environment variable' -- 'The system cannot find the path specified.'
CSC:警告 CS1668:“LIB 环境变量”中指定的搜索路径“\vc98\lib”无效--“系统找不到指定的路径。” CSC:警告 CS1668:在“LIB 环境变量”中指定的搜索路径“\vc98\mfc\lib”无效--“系统找不到指定的路径。'CSC:警告 CS1668:'LIB 环境变量'中指定的无效搜索路径'c:\program files\microsoft visual studio 9.0\vc\platformsdk\lib'--'系统找不到指定的路径。'
I have checked http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/3f875480-fee2-4bc3-b829-95e220b22a01and it doesn't offer me any help because my LIB and INCLUDE environment variables are not set either in the user vars or the system vars. I've looked at Studio's Tools > Options > Projects and Solutions> VC++ Directories and there's nothing that references anything old:
我检查了http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/3f875480-fee2-4bc3-b829-95e220b22a01它没有给我任何帮助,因为我的 LIB 和 INCLUDE 环境变量未在用户变量或系统变量中设置。我查看了 Studio 的工具 > 选项 > 项目和解决方案 > VC++ 目录,没有任何引用旧内容的内容:
Library Files: $(VCInstallDir)lib $(VCInstallDir)atlmfc\lib $(VCInstallDir)atlmfc\lib\i386 $(WindowsSdkDir)\lib $(FrameworkSDKDir)lib $(VSInstallDir) $(VSInstallDir)lib
库文件: $(VCInstallDir)lib $(VCInstallDir)atlmfc\lib $(VCInstallDir)atlmfc\lib\i386 $(WindowsSdkDir)\lib $(FrameworkSDKDir)lib $(VSInstallDir) $(VSInstallDir)lib
Include files:
包含文件:
$(VCInstallDir)include $(VCInstallDir)atlmfc\include $(WindowsSdkDir)include $(FrameworkSDKDir)include
$(VCInstallDir)include $(VCInstallDir)atlmfc\include $(WindowsSdkDir)include $(FrameworkSDKDir)include
I used diagnostic output so that I could see exactly what the LIB variable includes when being called:
我使用了诊断输出,以便我可以准确地看到 LIB 变量在被调用时包含的内容:
lib = c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib;\vc98\lib;\vc98\mfc\lib;c:\program files\microsoft visual studio 9.0\vc\platformsdk\lib;c:\program files\microsoft visual studio 9.0\vc\lib;c:\program files\microsoft visual studio 9.0\vc\atlmfc\lib; LIBPATH = c:\Windows\Microsoft.NET\Framework\v3.5;c:\Windows\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB
lib = c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c:\Program Files\Microsoft Visual Studio 9.0\VC\LIB;C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib ;\vc98\lib;\vc98\mfc\lib;c:\program files\microsoft visual studio 9.0\vc\platformsdk\lib;c:\program files\microsoft visual studio 9.0\vc\lib;c:\program files \microsoft Visual Studio 9.0\vc\atlmfc\lib; LIBPATH = c:\Windows\Microsoft.NET\Framework\v3.5;c:\Windows\Microsoft.NET\Framework\v2.0.50727;c:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB;c :\Program Files\Microsoft Visual Studio 9.0\VC\LIB
So if that vc98 is NOT in my env vars, or my studio settings and vc98 isn't even installed (nor the redist), where is that path coming from? What process sets up the LIB env var like that?
因此,如果 vc98 不在我的环境变量中,或者我的工作室设置和 vc98 甚至没有安装(也没有安装 redist),那么这条路径来自哪里?什么过程像那样设置 LIB 环境变量?
采纳答案by compie
Found on MSDN:
在MSDN 上找到:
Yes this is a known issue that occurs to some people. Look carefully in your LIB path. Right after ATLMFC, V, SDK -> \vc98\lib. Delete this entry (and the one that follows). If the LIB is a user variable then you'll need to restart VS or perhaps log off and back on. If it is a system variable then you'll have to reboot. Your error should then go away.
是的,这是一些人遇到的已知问题。仔细查看您的 LIB 路径。在 ATLMFC、V、SDK -> \vc98\lib 之后。删除此条目(以及后面的条目)。如果 LIB 是用户变量,那么您需要重新启动 VS 或注销并重新登录。如果是系统变量,则必须重新启动。你的错误应该会消失。
回答by Nachum
Here is the solution
这是解决方案
http://msdn.microsoft.com/en-us/library/tcbs315h(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/tcbs315h(v=vs.80).aspx
its refer to the LIB entry at Environment Variables
它指的是环境变量中的 LIB 条目
回答by Eamon Nerbonne
I'm having a very similar issue with C# projects in VS.NET2010. It appears only to affect those projects which import C++/CLI projects. The projects are still set to compile using the v9.0 toolset(C++, C++/CLI) and .NET 3.5 (C++/CLI, C#). Have you had any luck finding the source of the problem?
我在 VS.NET2010 中遇到了与 C# 项目非常相似的问题。它似乎只影响那些导入 C++/CLI 项目的项目。这些项目仍然设置为使用 v9.0 工具集(C++、C++/CLI)和 .NET 3.5(C++/CLI、C#)进行编译。你有没有运气找到问题的根源?
I worked around it by adding warning 1668 to the ignored warnings list in the properties of the affected projects. That's not ideal, but better than spam in my warnings list.
我通过将警告 1668 添加到受影响项目的属性中的忽略警告列表来解决它。这并不理想,但比我的警告列表中的垃圾邮件要好。
回答by RedBlueThing
Seems like you have covered most things here, so the only thing I can think of is inherited property sheets.
似乎你已经涵盖了这里的大部分内容,所以我唯一能想到的就是继承的属性表。
They are specified in the vcproj XML (or you can check the Property Manager in the IDE):
它们在 vcproj XML 中指定(或者您可以在 IDE 中检查属性管理器):
<VisualStudioProject>
<Configurations>
<Configuration InheritedPropertySheets="stuff.vsprops">...
If you do have some inherited property sheets, go have a look in the file and see if you have any vc98 lib paths set explicitly?
如果您确实有一些继承的属性表,请查看文件,看看您是否明确设置了任何 vc98 lib 路径?
回答by ChrisBD
I am wondering if this could be due to the change in using the compiler switches /MT and /MTd from /ML and /MLd which occured for VS2005 relating to C runtime libraries?
我想知道这是否可能是由于在与 C 运行时库相关的 VS2005 中使用 /ML 和 /MLd 中的编译器开关 /MT 和 /MTd 发生了变化?
Refer to here and see if it helps: http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx
参考这里看看是否有帮助:http: //msdn.microsoft.com/en-us/library/abx4dbyh.aspx