glog doesn't work with non-CMake #39300
-
I am using the non-CMake version of Visual Studio, and I installed glog with vcpkg. However, I get the following error when trying to include the library:
Tried to resolve the above by adding #define GLOG_USE_GLOG_EXPORT, I get another error:
Opened up a question on glog github, and they confirmed that they only support Bazel & CMake. Has anyone managed to get the non-CMake to work for glog? Is the expectation that every vcpkg package should work with non-CMake? Could the doc be updated if the expecation is incorrect (currently it sounds like it should just work magically on Visual Studio)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
By "non-CMake version of Visual Studio", do you mean MSBuild? In general, it is up to library authors to determine their level of integration with different build systems, operating systems, or architectures. vcpkg does not make any guarantees of support beyond what the library already offers. vcpkg broadly integrates with MSBuild, but not every individual library may work properly with MSBuild. If the library authors explicitly only support Bazel and CMake, it sounds like you would need to use one of those build systems with that library unless someone submits a PR to them to add support for MSBuild. |
Beta Was this translation helpful? Give feedback.
-
I encountered the same issue while using vcpkg glog 0.7.1 in VS2019. I believe it's a bug in glog that failed to handle MSBuild's 4996. Here's how I fixed it: #if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable : 4996)
#endif // _MSC_VER
#include <glog/logging.h>
#if defined(_MSC_VER)
# pragma warning(pop)
#endif // _MSC_VER |
Beta Was this translation helpful? Give feedback.
By "non-CMake version of Visual Studio", do you mean MSBuild? In general, it is up to library authors to determine their level of integration with different build systems, operating systems, or architectures. vcpkg does not make any guarantees of support beyond what the library already offers. vcpkg broadly integrates with MSBuild, but not every individual library may work properly with MSBuild. If the library authors explicitly only support Bazel and CMake, it sounds like you would need to use one of those build systems with that library unless someone submits a PR to them to add support for MSBuild.