I'm trying to make my C++ into a .lib file to use with my projects.
I have the files Log.h
and Log.cpp
.
I went into my project properties in Visual Studio and changed the configuration type from .exe
to .lib
. I set the build mode to Release
and built my class into a file called Log.lib
.
In a new C++ project, I'm trying to include that .lib
file I made along with the Log.h
file. All was successful, it recognised my functions, but when I try to run my exe program with my included Log.h
, I get the following errors:
mismatch detected for '_ITERATOR_DEBUG_LEVEL':
value '2' doesn't match value '0' in main.obj
By referencing this stackoverflow post, I discovered that building and running my new project in Release
mode (the same as the .lib
mode) removes the errors and I can successfully run my program and use the Log.h
.
How can I compile my Log.h
lib to be compatible with both Debug
and Release
?