在Windows上安装GLog [英] Installing GLog on Windows

查看:614
本文介绍了在Windows上安装GLog的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要安装GLog才能在OpenCV中使用SFM模块.

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.

还有一个" README.windows "文件,但并没有真正的帮助.
我正在使用 Windows Microsoft Visual Studio 2013 .

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

推荐答案

Glog具有.sln文件和VS项目文件,但是它们已过时且无法维护.因此正确的方法是使用cmake进行构建.

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.

这是构建和安装它的方法.它不仅限于glog,而且适用于大多数基于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. 安装正确版本的 cmake .通常最新的是最安全的.
  2. 打开cmake-gui.exe,并用它生成VS解决方案.
    • 在其顶部,填写源代码文件夹(如D:/glog-0.3.5)和生成位置(如D:/glog-0.3.5/build).后者是将生成整个VS解决方案文件的位置.
    • 单击配置"按钮,它将使您选择平台.确保使用正确的.
    • 配置后,将列出选项列表,并且可能标记为红色.不要为红色而烦恼.只需遍历它们,然后修改所需的内容即可.
    • (仅适用于glog),您可能需要在Ungrouped Entries/gflags_DIR中指定gflags路径,或者通过取消选中WITH/WITH_GFLAGS来禁用gflags.另外,将CMAKE/CMAKE_INSTALL_PREFIX修改为非系统文件夹,否则您将需要管理权限才能运行INSTALL项目.
    • 如果您修改了任何项目,请再次按配置"以使其生效.
    • 正确配置所有内容后,按生成"以生成VS解决方案.然后,您可以通过单击打开项目"来打开它.
  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".

这篇关于在Windows上安装GLog的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆