Closed xsc351072127 closed 5 months ago
Having the same problem as you, I am using version 0.6.0 for the time being
I also came across this issue, so I rolled back to 0.6.0.
It is my mistake. I write the target_link_libraries (myapp glog) but not target_link_libraries (myapp glog::glog)
Sorry I will close this issue.
In short,I find build glog with cmake version 3.25.1. And use find_package() to add glog to the project, Do not add -DGLOG_USE_GLOG_EXPORT for the build command.
I installed Glog according to the document requirements.
I got the install log like these,all these is work find.
After I build myapp use cmake and use the find_package, with cmake 3.25.1,my cmake file
And build myapp,I got build error,My cmake output show that glog was found by find_package.
I got build error like this:
/usr/local/include/glog/logging.h:60:4: error: #error <glog/logging.h> was not included correctly. See the documentation for how to consume the library.
After some debugging I found, I can build the demo with this cmake and keep glog in my porject dir(with use add_subdirectory ):
The make show that this build will add -DGLOG_USE_GLOG_EXPORT but find_package() do not.