Cannot open include file: 'igraph_version.h'

Hello, I am struggling to implement iGraph in my Godot Module. (cpp project using SCons compiler)

`… fatal error C1083: Cannot open include file: ‘igraph_version.h’: No such file or directory
The include directory has the igraph.h file my project triggers this. The directory holds only a “igraph_version.h.in”

Honestly, I am pretty new to cpp so I do not know about file.h.in and its implications.
So any advice and help is welcome.

So about my setup.

  • I am on Windows 10. using Visual Studio Code Insider
  • Am compiling Godot without errors or problems. Using Scons compiler.
  • First time using CMAKE.
    • Installed defeult Cmake.
    • Installed chocolatey.
    • Installed winflexbison3 using chocolatey.
    • Used Git to clone igraph release 0.9
    • Created a sub folder build
    • From that folder using cmd (Run as admisitrator) i run “cmake …” resulting in files inside /build.
-- Version number from Git: 0.9.10-37-g545e779c7
-- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045.
--
-- -----[ Build configuration ]----
-- Version:    0.9.10-37-g545e779c7
-- CMake build type:        default
-- Library type:             static
--
-- ----------[ Features ]----------
-- GLPK for optimization:       yes
-- Reading GraphML files:        no
-- Thread-local storage:         no
-- Link-time optimization:       no
--
-- --------[ Dependencies ]--------
-- ARPACK:                 vendored
-- BISON:                       yes
-- BLAS:                   vendored
-- CXSparse:               vendored
-- FLEX:                        yes
-- GLPK:                   vendored
-- GMP:                    vendored
-- LAPACK:                 vendored
-- OpenMP:                      yes
-- PLFIT:                  vendored
--
-- -----------[ Testing ]----------
-- Diff tool:                    fc
-- Sanitizers:                 none
-- Code coverage:                no
-- Verify 'finally' stack:       no
--
-- --------[ Documentation ]-------
-- HTML:                         no
-- PDF:                          no
--
-- igraph configured successfully.
--
-- Configuring done (8.0s)
-- Generating done (4.9s)
 - Then running "cmake --build . --config Release --target install"
  -- Install configuration: "Release"
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/igraph.lib
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_adjlist.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_arpack.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_array.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_array_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_attributes.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_bipartite.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_blas.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_centrality.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_cliques.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_cocitation.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_cohesive_blocks.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_coloring.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_community.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_complex.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_components.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_constants.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_constructors.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_conversion.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_datatype.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_decls.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_dqueue.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_dqueue_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_eigen.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_embedding.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_epidemics.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_error.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_eulerian.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_flow.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_foreign.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_games.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_graphicality.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_graphlets.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_heap.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_heap_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_hrg.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_interface.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_interrupt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_iterators.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_lapack.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_layout.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_lsap.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_matching.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_matrix.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_matrix_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_memory.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_microscopic_update.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_mixing.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_motifs.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_neighborhood.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_nongraph.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_operators.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_paths.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_pmt_off.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_progress.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_psumtree.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_qsort.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_random.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_scan.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_scg.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_separators.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_sparsemat.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_spmatrix.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_stack.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_stack_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_statusbar.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_structural.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_strvector.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_topology.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_transitivity.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_types.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_vector.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_vector_pmt.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_vector_ptr.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_vector_type.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_visitor.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_export.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_threading.h
  -- Up-to-date: C:/Program Files (x86)/igraph/include/igraph/igraph_version.h
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/pkgconfig/igraph.pc
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/cmake/igraph/igraph-config.cmake
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/cmake/igraph/igraph-config-version.cmake
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/cmake/igraph/igraph-targets.cmake
  -- Up-to-date: C:/Program Files (x86)/igraph/lib/cmake/igraph/igraph-targets-release.cmake

You need to build and install igraph first, then use it from the installed location.

Do check the installation instructions and tutorial if you haven’t yet: igraph Reference Manual Example projects are available at GitHub - igraph/igraph-example: Example projects that demonstrate the usage of igraph I do not know what Godot and SCons are so I can’t help you there.

Why don’t you use the latest release?

In fact, if you are on Windows, you should consider installing igraph with vcpkg, which always has the latest stable release.

I do not recommend using administrator privileges for software development. Using C:\Program Files as the installation location also seems like a bad idea. Install it someplace within your home directory instead. Now look in the include directory within the directory where you installed igraph and you will see igraph_version.h there (and NOT igraph_version.h.in).

“cmake --build . --config Release --target install” is the installation process not? I got that from the manual.
release/0.9 seems to be the latest release branch on Git?

Do app users need to install iGraph? I was hoping to create a new instance at runtime.

@szhorvat thank you for the pusch to vcpkg.
It really helped.

Still running into a few errors, I think these are mostly on Godot side of things.

  • prefix_build_info.igraph.lib is expected.
  • and I need to export or embed the required dll files to the .exe

For anyone interested, now my SCsub file looks like this

import os
import SCons.Builder

Import('env')

env_igraph = env.Clone()

env_igraph.add_source_files(env.modules_sources, "*.cpp") # Add all cpp files to the build
env_igraph.add_source_files(env.modules_sources, "*src/*.cpp")

env_igraph.Append(CPPPATH=['F:/vcpkg/installed/x64-windows/include'])
env.Append(LIBPATH=['F:/vcpkg/installed/x64-windows/lib'])
env.Append(LIBS=['igraph'])