vs2017版本更新后,win32控制台项目消失

1.这样创建会出现上述错误

新建项目,选择DLL(通用Windows)

VS2017创建动态库 error:MSB8024

2.在项目中添加一个空的cpp文件

输入以下代码

_declspec (dllexport)int Add(int a, int b) {

return a+b;

}

3.右击项目->属性,设置以下三步


VS2017创建动态库 error:MSB8024
VS2017创建动态库 error:MSB8024
VS2017创建动态库 error:MSB8024

编译,出现错误提示


VS2017创建动态库 error:MSB8024

查阅百度,知乎,必应,csdn,均未找到解决方法,最后发现新建项目里有一个“Windows桌面向导”,按以下步骤创建一个新项目


VS2017创建动态库 error:MSB8024

同上,新添加一个源文件,输入以下代码

_declspec(dllexport)int Add(int a, int b) {

return a + b;

}

然后设置三步(同上),编译,编译成功,生成以下文件

成功

VS2017创建动态库 error:MSB8024
VS2017创建动态库 error:MSB8024

VS2017创建动态库 error:MSB8024
图片发自简书App

相关文章:

  • 2021-06-07
  • 2022-12-23
  • 2021-07-05
  • 2021-04-12
  • 2021-05-11
  • 2022-01-16
  • 2021-05-07
猜你喜欢
  • 2021-11-27
  • 2022-01-05
  • 2021-05-29
  • 2021-09-15
  • 2021-08-31
  • 2021-04-21
  • 2021-09-08
相关资源
相似解决方案