Yishi Lin

  • Home

  • Archives

  • Dataset

  • Blog

  • Categories

  • Search

Compiling igraph projects in Visual Studio 2013

Posted on 2015-07-04 In Network Science , Tools

Download

Currently, I am testing igraph-0.7.1-msvc. http://igraph.org/c/#downloads

Compile the igraph library

  1. Open the igraph.sln solution file in igraph-0.7.1-msvc from Visual Studio 2013. Let the Visual Studio convert the solution file for you.
  2. Add a compiler option (for both Debug and Release): Open Project menu -> Properties -> C/C++ -> Command Line. In Additional options, add the following option: “/DPRPACK_IGRAPH_SUPPORT=1” (without the quotes)
  3. Debug -> Build and Release -> Build

Compile igraphtest

  1. Adding a path to the directory containing ‘igraph.lib’ (for both Debug and Release). Open Project -> Properties -> VC++ Directory -> Library Directory -> Edit. Add new path which points to the Debug/Release directory in your igraph directory (igraph-0.7.1-msvc folder/Debug, for example).
  2. Open Project -> Properties -> VC++ Directory -> Include Directory -> Edit. Add new path which points to the include directory in your igraph-0.7.1-msvc folder.
  3. Make sure “Project -> Properties -> Linker -> General -> Additional Library Directories” points to your igraph Debug/Release directory.
  4. Make sure the setting of “Project -> Properties -> C/C++ -> Code Generation -> Runtime Library” in the Debug mode (resp. Release mode) matches the setting in the Debug (resp. Release mode) mode of the igraph project.

Compile other projects

  1. Error: “error LNK2001: unresolved external symbol “public: __thiscall prpack….”. Fix:

    1. Make a new folder “prpack” in your <your_project_src> folder.
    2. Copy igraph-0.7.1-msvc folder/prpack/prpack_* to <your_project_src>/prpack folder.
    3. In Visual Studio 2013, Add prpack_* to your “Header Files” and “Source Files”
    4. Add a compiler option (for both Debug and Release): Open Project menu -> Properties -> C/C++ -> Command Line. In Additional options, add the following option: “/DPRPACK_IGRAPH_SUPPORT=1” (without the quotes)
    5. Edit your prpack_solver.cpp, add “#include <algorithm>#, otherwise you may see a compile error.
  2. Error during debugging: “Run time Check failure #3: * is being used without being initialized”. I saw this error when I run the “example/eigenvector_centrality.c” provided by igraph. Because I do not want to modify their codes, here goes my fix (yes, I know turn this off is not a good idea):

    1. While compiling igraph and your project, set “Open Project -> Properties -> C/C++ -> Code Generation -> Basic Runtime Checks” as “Default”.

The above steps help me compile my first igraph project successfully finally. I will keep updating this list if I see more errors…

Reference:

  1. https://dungleba.wordpress.com/2014/10/14/installing-igraph-in-visual-studio-2013/
  2. http://stackoverflow.com/questions/26579997/igraph-c-compiling-link-errors-in-visual-studio
# igraph # network sciences # visualstudio
My LeetCode Notebook
  • Table of Contents
  • Overview
Yishi Lin

Yishi Lin

24 posts
11 categories
25 tags
RSS
GitHub E-Mail
  1. 1. Download
  2. 2. Compile the igraph library
  3. 3. Compile igraphtest
  4. 4. Compile other projects
  5. 5. Reference:
© 2013 – 2021 Yishi Lin
Powered by Hexo v3.9.0
|
Theme – NexT.Gemini v7.3.0