Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

编译WTL程序链接时会提示没有std::nothrow #21

@waiting4love

Description

@waiting4love

无法解析的外部符号 "struct std::nothrow_t const std::nothrow" (?nothrow@std@@3Unothrow_t@1@B),该符号在函数 "public: int __thiscall ATL::CExpansionVector::Add(wchar_t const *,wchar_t const *)" (?Add@CExpansionVector@ATL@@QAEHPB_W0@Z) 中被引用

分析:
statreg.h文件中CExpansionVector::Add用到了_ATL_NEW
_ATL_NEW的定义在atldef.h中,#define _ATL_NEW new(std::nothrow)

解决:
方案一、在自己的程序里定义一个全局变量 struct std::nothrow_t const std::nothrow;
方案二、预定义_ATL_DISABLE_NOTHROW_NEW

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions