Please help me, I can not compile c++ code with ogdf libraries

141 views
Skip to first unread message

Arman Mohseni Kabir

unread,
Apr 13, 2018, 6:34:48 PM4/13/18
to ogdf
I downloaded OGDF and build it in linux. 

I have demo.cpp file to test if I can compile my code, but it does not work. 

The problem seems to be that the path to dependencies of the libraries being called in the demo.cpp is not recognized. 

My demo.cpp is this code:

#include "include/ogdf/basic/Graph.h"

namespace ogdf;
 
int main()
{
 Graph G;

}


I use this command to run the code:

g++ -std=c++11 -I./home/arman/ogdf/include -pthread -lm demo.cpp -LOGDF -LCOIN -DNDEBUG


and it gives me this error:

include/ogdf/basic/Graph.h:34:29: fatal error: ogdf/basic/List.h: No such file or directory
compilation terminated.


(List.h is a library called in graph.h so it seems that recognizes graph.h but does not recognize List.h which is in the same directory)


I appreciate your help.


Stephan Beyer

unread,
Apr 16, 2018, 12:20:38 PM4/16/18
to og...@googlegroups.com
On 04/14/2018 12:34 AM, Arman Mohseni Kabir wrote:
> I use this command to run the code:
>
> g++ -std=c++11 -I./home/arman/ogdf/include -pthread -lm demo.cpp
> -LOGDF -LCOIN -DNDEBUG

There are several problems with that invocation.

First, I guess the correct path for your includes is
/home/arman/ogdf/include
and not
./home/arman/ogdf/include

Second, it is -lOGDF -lCOIN, not -LOGDF -LCOIN.
However, with -L you have to specify the paths where the OGDF and
COIN object files are located (e.g., -L/home/arman/ogdf/ if you have
not used an out-of-source build).

I urge you to look at the documentation in doc/build.md

Thanks
Stephan

Arman Mohseni Kabir

unread,
May 2, 2018, 10:40:52 AM5/2/18
to ogdf
Thank You. 

I figured it out.
Reply all
Reply to author
Forward
0 new messages