gpt4 book ai didi

c++ - 如何在 Visual C++ .exe 项目中不创建 .lib 和 .exp 文件

转载 作者:行者123 更新时间:2023-12-05 07:54:03 25 4
gpt4 key购买 nike

当我在 Visual Studio 中使用 .exe 输出构建我的 C++ 项目时,它会为我的项目创建一个 .lib 和 .exp 文件,这会花费很多时间。我在 stdafx.h(预编译 header )的开头添加了 _DO_NOT_EXPORT 条件以尝试跳过此步骤,但它仍会在每次构建结束时创建 .lib 和 .exp 文件。我是否在正确的位置添加了条件?

最佳答案

为了它的值(value),你可以禁用该 block

#if defined(BOOST_HAS_DECLSPEC) && !defined(__COMO__)
# if defined(__BORLANDC__)
# define BOOST_DLLEXPORT __export
# else
# define BOOST_DLLEXPORT __declspec(dllexport)
# endif
#elif ! defined(_WIN32) && ! defined(_WIN64)
# if defined(__MWERKS__)
# define BOOST_DLLEXPORT __declspec(dllexport)
# elif defined(__GNUC__) && (__GNUC__ >= 3)
# define BOOST_USED __attribute__ ((used))
# elif defined(__INTEL_COMPILER) && (BOOST_INTEL_CXX_VERSION >= 800)
# define BOOST_USED __attribute__ ((used))
# endif
#endif

在 Boost 的 serialization/force_include.hpp 中。

引用:http://lists.boost.org/boost-users/2008/06/37175.php

关于c++ - 如何在 Visual C++ .exe 项目中不创建 .lib 和 .exp 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31858938/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com