在Visual Studio 2010和Cygwin / MinGW中安装igraph的各种问题(“sys / time.h not found”) [英] Various issues installing igraph in Visual Studio 2010 and Cygwin/MinGW ("sys/time.h not found")

查看:1757
本文介绍了在Visual Studio 2010和Cygwin / MinGW中安装igraph的各种问题(“sys / time.h not found”)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法得到的工作与Visual Studio 2010(据称许多已知的问题),所以决定尝试安装它在Cygwin。 ./ configure 很好。但 make 发生此错误:

I couldn't get igraph to work with Visual Studio 2010 (supposedly many known issues), and so decided to try installing it in Cygwin. ./configure went fine. But make gave this error:

f2c/dtime_.c:16:23: fatal error: sys/times.h: No such file or directory

Makefile:2190: recipe for target `libf2c_la-dtime_.lo' failed
make[3]: *** [libf2c_la-dtime_.lo] Error 1

我试过在MinGW中安装它,当我 make 时出错。我应该提供sys / time.h还是路径呢? sys / time.h在哪里?使用Windows 7。

I tried installing it in MinGW and get the same error when I make. Should I be providing "sys/time.h" or a path to it? Where is sys/time.h? Using Windows 7.

编辑

Cygwin和MinGW的问题到我的干净的安装Cygwin(和MinGW的特性)使用的错误版本的gcc。此处的解决方案:在Cygwin中安装/编译/ MinGW - 如何设置包含路径? (符号链接?)

The problems in Cygwin and MinGW was due to the wrong version of gcc being used by my clean installation of Cygwin (and a characteristic of MinGW). Solution here: Installing/compiling in Cygwin/MinGW - How to set the include "path"? (symbolic link?)

Visual Studio 2010中的问题是由于在调试而不是发布中创建。

The problem in Visual Studio 2010 was due to building in "Debug" instead of "Release". One of igraph's creator, Gábor Csárdi, graciously provided an excellent step-by-step guide below that identified and resolved it.

推荐答案


  1. 下载
  2. 将文件解压缩到我的文档\Visual Studio 2010 \Projects 。 c / c> c。 msvc \igraph-0.6-msvc 目录。

  3. Visual Studio提供将解决方案文件转换为当前格式。

  4. 在工具栏上,将调试更改为释放以发布版本。

  5. 选择调试 - >构建解决方案并等待库建立完成。

  1. Download the source package specifically created for Visual Studio.
  2. Uncompress the file into My Documents\Visual Studio 2010\Projects.
  3. Open the igraph.sln solution file in igraph-0.6-msvc\igraph-0.6-msvc directory from Visual Studio.
  4. Visual Studio offers to convert the solution file to the current format, do that. Just click on Next, Next and Finish.
  5. On the toolbar, change 'Debug' to 'Release' to make release builds.
  6. Choose Debug -> Build solution and wait until the library is built.

要测试它,您可以在 igraphtest 目录,转换它,选择释放构建,然后构建它,并从命令行运行它。它是一个简单的C ++程序,使用igraph来创建一个图形并将其写入文件 out.txt

To test it you can open the solution file in the igraphtest directory, convert it as well, choose 'Release' builds, and then build it and run it from the command line. It is a simple C++ program that uses igraph to create a graph and write it into the file out.txt.

您不必设置include和library目录,一切都在解决方案文件中正确设置,无论是对于igraph还是igraph。

You don't have to set up include and library directories at all, everything is set up properly in the solution file, both for igraph and igraphtest.

这篇关于在Visual Studio 2010和Cygwin / MinGW中安装igraph的各种问题(“sys / time.h not found”)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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