文件说明
- Download the source files forGCC 4.7.0.
适用于GCC 4.7.0.或更高版本GCC - Download the source code files forMS Visual Studio 2012
适用于Visual Studio 2012或更高版本 - Download the source code files for GCC pre-C++ 11 compilers 2012.
适用于GCC 4.7.0之前版本,不使用c++0x或c++11的新标准。 - Download the source code files for Microsoft pre-C++ 11 compilers.
适用于Visual Studio 2012之前版本
编译器
- VS Studio 2017
编译
参考官方说明,找到Developer Command Prompt for VS 2017打开。
进入要编译的文件夹,参考README中的命令,输入nmake。
报错信息参考官方说明https://docs.microsoft.com/zh-cn/cpp/error-messages/
- 报错:error C2732: 链接规范与“lround”的早期规范 冲突
打开Version_test.h 文件
将该文件末尾的
# ifndef LROUND
inline long lround(double d)
{
return (d >= 0) ? long(d + 0.5) : long(d - 0.5);
}
# endif
改为
# ifdef LR

本文提供了C++ Primer 5th 源代码的下载及编译说明,针对GCC 4.7.0及以上、Visual Studio 2012及以上以及旧版编译器的源代码文件。在VS Studio 2017中,使用nmake编译时可能遇到错误,如C2732和C2440,错误处理和解决方案也一并给出。
最低0.47元/天 解锁文章
504

被折叠的 条评论
为什么被折叠?



