2

I am new to Linux and working in its environment.
I have trouble understanding and installing SNAP library for C++ on Ubuntu 14.04.

I am following this tutorial.

Inside the SNAP directory I run the make all command and it compiles the examples and headers, and of course after the test example is running smoothly.

cd examples/graphgen
./graphgen -g:w -n:1000 -k:4 -p:0.1 -o:smallworld.txt

Also I compile the tests in test with make run-all-tests and they all passed.

But I am having this problem.

I don't install the lib and headers somewhere (ex. /usr/include or /lib or /usr/lib…). This example only compile in its directory.

And when I am trying to run my example I get errors like

#include <Snap.h> :: error no such file or directory

Like I said, I am new to cmake and make, so I would gladly appreciate your help.

2
  • I guess you're somehow trying to run the source code instead of the executable. Which command are you running?
    – kos
    Jul 20, 2015 at 10:42
  • Please post your example that I can test it.
    – A.B.
    Jul 20, 2015 at 10:54

1 Answer 1

1

Add the path to the header (snap-core, snap-adv, glib-core, snap-exp) and the object file Snap.o


Example for: examples/graphgen/graphgen.cpp:

g++ graphgen.cpp  ../../snap-core/Snap.o -I../../snap-core -I../../snap-adv -I../../glib-core -I../../snap-exp
3
  • @Schrodinger You're welcome
    – A.B.
    Jul 20, 2015 at 11:43
  • But can you help e with the export PATH var ? Also can you make a short tutorial where to copy the files for example in /usr/local/include and how to export the PATH var in .bashrc ?
    – user117703
    Jul 20, 2015 at 11:46
  • ohh memories...
    – user117703
    Dec 4, 2019 at 13:51

You must log in to answer this question.