如何使用 Visual C++ 2010 Express 构建 Notepad++? [英] How do I build Notepad++ with Visual C++ 2010 Express?

查看:78
本文介绍了如何使用 Visual C++ 2010 Express 构建 Notepad++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows SDK 已安装.我之前用 Visual C++ 2008 Express 成功构建了 N++.但是现在到了 2010 年,我有很多关于 sprintf_s 的错误消息:

Windows SDK is installed. I built N++ successfully with Visual C++ 2008 Express before. But now with 2010 I have a lot of error messages about sprintf_s:

1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\string(676): error C2039: 'sprintf_s' : is not a member of '`global namespace''
1>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\string(676): error C3861: 'sprintf_s': identifier not found

请帮忙.

推荐答案

项目中包含一个名为 no_ms_shit.props(转换后)的属性表.这份工作表中表达了对 MS 过去 5 年来一直在努力做的事情的相当多的仇恨.

There's a property sheet included with the project named no_ms_shit.props (after conversion). There's a fair amount of hate expressed in that sheet for what MS has been trying to do for the past 5 years.

他们把所有东西都关掉了,他们甚至禁用了与 sprintf_s() 的链接.这是错误的根源,stdio.h 标头省略了声明,但字符串标头使用了它.不确定 Express 版是否支持编辑项目属性表,但零售版中的步骤是:

They went a little too over-board with turning everything off, they even disabled linking to sprintf_s(). Which is the source of your error, the stdio.h header omits the declaration but the string header uses it. Not sure if the Express edition supports editing project property sheets, but the step in the retail edition are:

  • 查看 + 物业经理
  • 打开其中一个节点并找到no ms shit"
  • 右键单击它,属性
  • C/C++、预处理器、预处理器定义
  • __STDC_WANT_SECURELIB__=0 更改为 1
  • 将 _CRT_SECURE_NO_WARNINGS 添加到这些定义中

项目现在编译干净了.我确实收到了复制文件的构建错误,这是一个构建后事件.如果您不知道如何解决,请提出另一个问题.

The project compiles clean now. I do get a build error for copying files, it is a post-build event. Start another question if you can't figure out how to fix it.

这篇关于如何使用 Visual C++ 2010 Express 构建 Notepad++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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