When I build my VS project as Debug, it always auto-linked with tbb_debug.lib (which in turn linked with tbb_debug.dll). Is there a way to override this and make tbb.lib linked even for a Debug build?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
First, are you sure it is 'auto-linked'?
If so, this is done using
#pragma comment( lib, tbb_debug.lib )
. Find where this code is, modify it if it's yours, or else disbale it somehow (either by do not including the file where that code is, or by #defining something that disables this piece code; any sane library writer should provide such a mechanism and it should be documented clearly as well).If there is no such pragma, the library is linked because it appears in the project settings. Right-click project->Properties->Linker->Input and adjust.
Edit thanks to Alexey's comment it seems that you can probably disable TBB's autolinking, as seen in this header file. Defining
__TBB_NO_IMPLICIT_LINKAGE
should do the trick.If the autolinking with
tbb_debug.lib
is accomplished with:then as explained on the MSDN documentation page for
pragma comment
:You could disable the autolinking via
#pragma comment( lib, "tbb_debug" )
by passing the linker option/NODEFAULTLIB:tbb_debug.lib
.However, are you asking because you are receiving a "multiply defined symbols" error (LNK1169) or perhaps LNK4098? If so, it may be that you have
tbb.lib
listed as input to linker for both Debug and Release profiles. You should remove this entry for the Debug profile as the correct library is being automatically linked in.