[gecode-users] An error in the linking of an example

Claudio Cesar de Sá claudio at colmeia.udesc.br
Mon Jan 18 12:26:36 CET 2010


Guido:

Really, the link for the gecodedriver library was missing. This detail was
not in the
example in the manual. Everything  works fine.

 My  script is done by:
#!/bin/bash

echo ""

g++ -I/usr/local/include -c money.cpp
echo "compilou ok"
g++ -o money_exe -L/usr/local/lib money.o \
  -lgecodeint -lgecodesearch -lgecodekernel -lgecodesupport -lgecodedriver
echo "linkeditou ok"
./money_exe
echo " FIM "

The execution is:

....../gecode-3.2.2/examples# sh sh_comp_money

compilou ok
linkeditou ok
SEND+MORE=MONEY
    {9, 5, 6, 7, 1, 0, 8, 2}

Initial
    propagators: 2
    branchers:   1

Summary
    runtime:      0.000 (0.197000 ms)
    solutions:    1
    propagations: 14
    nodes:        7
    failures:     3
    peak depth:   3
    peak memory:  10 KB
 FIM


Thanks for all for help me


claudio


2010/1/18 Christian Schulte <cschulte at kth.se>

>  Hi, I just added tips about how to link when you use Gist or the
> commandline driver to Modeling with Gecode.
>
>
>
> Christian
>
>
>
> --
>
> Christian Schulte, www.ict.kth.se/~cschulte/<http://www.ict.kth.se/%7Ecschulte/>
>
>
>
> *From:* users-bounces at gecode.org [mailto:users-bounces at gecode.org] *On
> Behalf Of *Guido Tack
> *Sent:* Friday, January 15, 2010 5:15 PM
> *To:* Claudio Cesar de Sá
> *Cc:* users at gecode.org
> *Subject:* Re: [gecode-users] An error in the linking of an example
>
>
>
> Hi,
>
>
>
> you also have to link -lgecodedriver.  We should probably mention that in
> the section about the driver model in "Modeling with Gecode".
>
>
>
> Cheers,
>
>             Guido
>
>
>
> Claudio Cesar de Sá wrote:
>
>
>
>  Hi
>
>
> I just finish to install the gecode, last version in a linux machine.
> I add this line  in .bashrc
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
> for the right acess in the Gecode lib.
>
> In the compilation phase with a example:
> g++ -I/usr/local/include -c money.cpp
> runs fine.
>
> However in the linkedition:
> claudio at goedel:~/principal/gecode-3.2.2/examples$ g++ -o money_exe
> -L/usr/local/lib money.o \
> >   -lgecodeint -lgecodesearch -lgecodekernel -lgecodesupport
>
> The errors appears, please; below:
>
> money.o: In function `main':
> money.cpp:(.text+0x8a): undefined reference to
> `Gecode::Options::Options(char const*)'
> money.cpp:(.text+0x13d): undefined reference to
> `Gecode::BaseOptions::parse(int&, char**)'
> ................................
> ................................
> money.o:(.rodata._ZTVN6Gecode7OptionsE[vtable for Gecode::Options]+0x8):
> undefined reference to `Gecode::BaseOptions::help()'
> money.o:(.rodata._ZTIN6Gecode7OptionsE[typeinfo for Gecode::Options]+0x8):
> undefined reference to `typeinfo for Gecode::BaseOptions'
> collect2: ld returned 1 exit status
>
>
> As I am not a C++ expert, somone could help me?
>
>
> The enviroment variables are:
> LD_LIBRARY_PATH=:/usr/local/lib
> PATH=/usr/local/bin:/usr/bin:/bin:/usr/games
>
> Thanks in advance:::
>
>
> claudio cesar
>
>
>
>    (
>    ))
>   |""|-.
>   |__|-'
>
>
> **********************************************************************
>  Skype: claudio_cesar_sa
>
> Meus links:
>
> http://www.colmeia.udesc.br
> http://www.joinville.udesc.br/coca
> http://www.joinville.udesc.br/maratona
> Blog: http://claudiocesar.wordpress.com/
> ***********************************************************************
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>
>



-- 
claudio cesar



   (
   ))
  |""|-.
  |__|-'


**********************************************************************
 Skype: claudio_cesar_sa

Meus links:

http://www.colmeia.udesc.br
http://www.joinville.udesc.br/coca
http://www.joinville.udesc.br/maratona
Blog: http://claudiocesar.wordpress.com/
***********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20100118/d1be75c0/attachment.htm>


More information about the users mailing list