How to not create .lib and .exp files in Visual C++ .exe project

1.9k Views Asked by At

When I build my C++ project with .exe output in Visual Studio, it creates a .lib and .exp file of my project, and it takes a lot of time. I added the _DO_NOT_EXPORT condition at the beginning of stdafx.h (precompiled header) in attempt to skip this step, but it still creates .lib and .exp files at the end of every build. Have I added the condition at the right place ?

1

There are 1 best solutions below

0
On

For what it's worth, you may disable the 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

in serialization/force_include.hpp of Boost.

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