Installing GLog on Windows

↘锁芯ラ 提交于 2019-12-07 17:39:00

问题


I need to install GLog for using the SFM module in OpenCV.

I already found the link for the source code but I don't really know how to install it on my system as I dont have much experience with it.

There is also a "README.windows" file but it doesn't really help.
I am using Windows and Microsoft Visual Studio 2013.


回答1:


Glog has a .sln file and VS project files, but they are obsolete and out of maintenance. So the right way is to build using cmake.

Here's the way to build and install it. And it's not limited to glog, but applicable to most cmake-based projects.

  1. Install the right version of cmake. Usually the newest is the safest.
  2. Open cmake-gui.exe, and use it to generate VS solution.
    • At the top of it, fill in the source code folder (like D:/glog-0.3.5) and where to build (like D:/glog-0.3.5/build). The latter is where the whole VS solution files will be generated to.
    • Click "Configure" button, and it will let you select your platform. Be sure to use the right one.
    • After configuring, a list of options will be listed and probably marked as red. Don't be upset about the red. Just go through them, and modify those you want to.
    • (For glog only) You may need to specify gflags path in Ungrouped Entries/gflags_DIR or disable gflags by unchecking WITH/WITH_GFLAGS. Also, modify CMAKE/CMAKE_INSTALL_PREFIX to a non-system folder, otherwise you will need administrative privileges to run INSTALL project.
    • If you modified any items, press "Configure" again to make it work.
    • When everything is configured right, press "Generate" to generate VS solution. Then you can open it by clicking "Open Project".
  3. In the VS project, select the configuration you want to build (I mean x64/win32, Release/Debug, etc), then build ALL_BUILD to build the project. Then you can build INSTALL, this will copy the headers and libraries to CMAKE/CMAKE_INSTALL_PREFIX folder for a new project to use.



回答2:


I use visual studio community 2017. Just do open folder. With cmakelists.txt inside, visual studio detects this is a cmake project. Visual studio will build for you in the cmake way.



来源:https://stackoverflow.com/questions/41766969/installing-glog-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!