[Lemon-user] a problem when running lemon
Alpár Jüttner
alpar at cs.elte.hu
Sat Aug 14 07:41:19 CEST 2010
Hi Liyin,
The problem is that the glpk library should have also been linked to it.
If your system is properly set up,
$ g++ -o test lp_maxflow_demon.cc -lemon -lglpk
should work. Alternatively you can
$ LF = `pkg-config --cflags --libs lemon`
and then
$ g++ -o test lp_maxflow_demon.cc $LF
In fact, this solution should be preferred, especially in Makefiles,
because it makes it possible to use a LEMON version installed to a
nonstandard place.
Regards,
Alpar
> Hi
> I tried to use lemon to solve the min cost max flow problem.
> I installed glpk successfully, the lib files are
> under: /usr/local/lib/
> And I also can run the
> hello_lemon.cc( http://lemon.cs.elte.hu/pub/tutorial/sec_hello_lemon.html)
> But when I try to run another demon file:
> demo/lp_maxflow_demo.cc ( http://lemon.cs.elte.hu/pub/tutorial/a00003.html)
> I run the file by the command: g++ -o test lp_maxflow_demon.cc -lemon
> There are lots of compiler errors, which shows lemon cannot find the
> reference in thes glpk.cc
> for example:
> lemon/lemon-1.2/lemon/glpk.cc:169: undefined reference to
> `glp_get_mat_row'
> lemon/lemon-1.2/lemon/glpk.cc:907: undefined reference to
> `glp_set_col_kind'
> lemon/lemon-1.2/lemon/glpk.cc:907: undefined reference to
> `glp_set_col_kind'
>
> How can I solve this problem?
> Really appreciate your reply
>
> Thanks a lot
> Best Regards
> Liyin
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
More information about the Lemon-user
mailing list