Various issues installing igraph in Visual Studio 2010 and Cygwin/MinGW (“sys/time.h not found”)

别等时光非礼了梦想. 提交于 2019-12-08 12:15:52

问题


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

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.

Edit

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?)

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:


Igraph actually does work with Visual C++ 2010 Express, we test this before releases, and I have just tried it. You need to do the following steps.

  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.

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.

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.




回答2:


is there an sys/times.h file?

I have a vague memory that I had to make that symlink on a system once.



来源:https://stackoverflow.com/questions/12737397/various-issues-installing-igraph-in-visual-studio-2010-and-cygwin-mingw-sys-ti

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