[Lemon-user] strongly connected components
Alpár Jüttner
alpar at cs.elte.hu
Mon Sep 20 06:34:22 CEST 2010
On Sun, 2010-09-19 at 21:02 -0700, Mark W Redekopp wrote:
> Thanks, that worked. However, I have two more related questions to
> your eps saving method:
>
> 1.)
> I tried to compile the graph_to_eps_demo.cc available from your link.
>
> http://lemon.cs.elte.hu/pub/doc/1.1.1/a00302.html
Note that version 1.1.1 is not the latest one. Though it is still
supported, version 1.2 is recommended for its new features.
>
> When I compile (using g++ 3.4.4 on cygwin) I get the following
> errors:
>
> g++ -o lemon_test_eps -I /home/user/lemon-1.2
> -L /home/user/lemon-1.2/libemon.la lemon_test_eps.cpp
The option -L is used to add directories to the library search path.
Thus you should use it together with option -l. Alternatively, you can
directly give the .a file (not the .la one) to the compiler without any
option.
Finally, you must place the libraries _after_ the source code.
Therefore
* if /home/user/lemon-1.2 in your example is the installation prefix,
then the compilation command is either
g++ -o lemon_test_eps -I /home/user/lemon-1.2
-L /home/user/lemon-1.2/libs lemon_test_eps.cpp -lemon
or
g++ -o lemon_test_eps -I /home/user/lemon-1.2
lemon_test_eps.cpp /home/user/lemon-1.2/libs/libemon.a
* if /home/user/lemon-1.2 is the location of the source code and you
used autotool to build lemon, then the compilation command is either
g++ -o lemon_test_eps -I /home/user/lemon-1.2
-L /home/user/lemon-1.2/lemon/.libs lemon_test_eps.cpp -lemon
or
g++ -o lemon_test_eps -I /home/user/lemon-1.2
lemon_test_eps.cpp /home/user/lemon-1.2/lemon/.libs/libemon.a
> /tmp/ccH27lgD.o:lemon_test_eps.cpp:(.text
> $_ZN5lemon9distantBWERKNS_5ColorE[lemon::distantBW(lemon::Color
> const&)]+0x67): undefined reference to `lemon::WHITE'
> [...]
> /tmp/ccH27lgD.o:lemon_test_eps.cpp:(.text
> $_ZN5lemon23DefaultGraphToEpsTraitsINS_11ListDigraphEEC1ERKS1_RSob[lemon::DefaultGraphToEpsTraits<lemon::ListDigraph>::DefaultGraphToEpsTraits(lemon::ListDigraph const&, std::basic_ostream<char, std::char_traits<char> >&, bool)]+0x259): undefined reference to `lemon::BLACK'
> collect2: ld returned 1 exit status
>
> Any ideas where those constants are defined or what I'm doing wrong.
The reason for the error is that the lemon lib was not properly added.
See above.
> 2.) I wanted the above eps output capability for some other code I
> have. In that code I have an enum type:
>
> enum inst_type_enum {GATE,PI,PO,DFF,BBOX_IN, BBOX_OUT};
>
> As soon as I include the file:
>
> #include <lemon/graph_to_eps.h>
>
> I start to get errors that my PI enumeration is no longer defined.
> (see below)
>
> trust_wrap.cxx: In function `void init_trust()':
> trust_wrap.cxx:14228: error: `PI' undeclared (first use this
> function)
> trust_wrap.cxx:14228: error: (Each undeclared identifier is reported
> only once for each function it appears in.)
>
> Before when I didn't include <lemon/graph_to_eps.h> (and even when I
> comment it out) I get no errors. I'm not even trying to call any eps
> functions. Just including the header file. I wonder if it includes
> some other file that defines PI or changes something. Can you offer
> any insight why my 'PI' constant/enum would be altered or 'hidden' by
> include the graph_to_eps file?
Lemon defines a constant PI (for 3.141...), but it is inside the lemon
namespace (lemon::PI) therefore should not cause problem. Could you send
a small example that shows the symptoms?
Regards,
Alpar
More information about the Lemon-user
mailing list