在VS 2015中构建和编译Win32 c ++应用程序 [英] Building and compiling Win32 c++ application in VS 2015

查看:315
本文介绍了在VS 2015中构建和编译Win32 c ++应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我是VS的新手,来自c ++ linux世界,所以请跟我讨论愚蠢的问题。


To开始使用W32开发,我尝试了一个完全基本的Visual C ++ W32应用程序 - 即当您选择New - >时创建的默认应用程序。项目 - > Visual C ++ - > Win32 - > Win32项目,应用程序
类型:Windows应用程序,预编译头(X),安全开发Licecycle(X)。


众所周知,这创建了一个没有任何内容的基本W32应用程序不仅仅是一个窗口。


我可以通过选择Build - >来构建解决方案。构建解决方案(F6),它编译,构建和运行。


但是,如果我选择Build - >编译(Ctrl-F7),我收到以下错误信息:


错误     MSB3644    框架".NETFramework,Version = v4.0"的参考程序集没找到。要解决此问题,请为此框架版本安装SDK或Targeting Pack,或者将您的应用程序重新定位到
安装了SDK或Targeting Pack的框架版本。请注意,程序集将从全局程序集缓存(GAC)中解析,并将用于代替引用程序集。因此,对于您想要的框架,您的程序集可能无法正确定位
。    &的Win32 NBSP;    C:\Program Files(x86)\ MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets     1098


现在,既然我正在尝试创建一个Win32应用程序,我不明白它为什么抱怨.NET?


此外,构建的输出在哪里?我在Workspace\Solutionname \Projectname \文件夹中看不到可执行文件?

解决方案

Hello frankhovin


我创建了一个类似的项目,其中包含您在论坛中告诉我们的选项。我没有你描述的这个问题。


一般来说,你创建了一个本机代码项目。错误消息来自.NET。出于这个原因,我只能假设您在设置中更改了某些内容,并且您现在拥有一个使用本机代码和托管代码的混合项目。


您是否正在使用VS2015 Zpdate 3并且所有在线可用修复


I'm new at VS, having come from a c++ linux world, so please bear with me for asking stupid questions.

To get started with W32 development, I've tried a completely basic Visual C++ W32 application - namely the default application which is created when you select New -> Project -> Visual C++ -> Win32 -> Win32 Project, Application type: Windows application, Precompiled header (X), Security Development Licecycle (X).

As you all know, this creates a basic W32 application with nothing more than a window.

I can build the solution, by chosing Build -> Build Solution (F6), and it compiles, builds and runs.

However, if I select Build -> Compile (Ctrl-F7), I get the following error message:

Error    MSB3644    The reference assemblies for framework ".NETFramework,Version=v4.0" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.    Win32    C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets    1098

Now, since I'm trying to create a Win32 application, I don't understand why it's complaining about .NET?

Also, where is the output from the build? I can see no executable files in the Workspace\Solutionname\Projectname\ folder?

解决方案

Hello frankhovin

I created a similar project with the options you told us here in the forum. I do not have this problem you described.

In general, you reated a native code project. The error message comes from .NET. For this reason I can only assume that you changed something in your settings and you have now a mixed project that uses native code and managed code.

Are you using VS2015 Zpdate 3 with all online available fixes?


这篇关于在VS 2015中构建和编译Win32 c ++应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆