include could not find load file

I installed igraph on my Mac and tried build test program how it wrote in documentation with CMake. But when I write: cmake … -DCMAKE_PREFIX_PATH=/path, where the path is the same which installed with -DCMAKE_INSTALL_PREFIX=/opt/local I got error:

CMake Error at /Users/Desktop/test_graph/igraph-0.10.4/build/igraph-config.cmake:28 (include):
include could not find load file:

/Users/Desktop/test_graph/igraph-0.10.4/build/igraph-targets.cmake

Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)

When I tried to compile project without cmake I got error:

Undefined symbols for architecture x86_64:
“_main”, referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64

Please help me.

I cannot immediately tell what went wrong, but it seems likely that you did not follow the instructions in the tutorial precisely. I suggest double-checking that.

If you didn’t spot the mistake, please show a complete terminal transcript of installing igraph (from a fresh start) and trying to build your own project. Make sure you start with a clean slate and that you include the complete transcript. Hopefully we will spot the problem.

Please also share your project’s CMakeLists.txt.

I did everything as it was indicated in documentation. I didn’t spot the mistake but I built the project in CLion and I rewrote cmake-file as it was indicated in tutorial. This was the solution of my problem. Everything work good.

If somebody get similar problem - try build the project with IDE.

Glad that you managed to solve the problem, but for future readers: While an IDE can be convenient to use, it is not necessary to write a correct CMakeLists.txt.

1 Like