On 14 Aug 2009, at 15:17, amina kemmar wrote:

Hi,
I have implemented a constraint named "Aminadistinct(Space& home, const IntVarArgs& x, IntConLevel icl)", I considere just the value consistency,
so, I generate the following files:

gecode/int/Aminadistinct.hh
gecode/int/Aminadistinct.cpp
gecode/int/AminaDistinct/val.hpp

for the compilation, I modified the makefile, by adding these three files to INTSRC0, INTHDR0 and SETBUILDDIRS.

when I compile gecode :
$make
$make install

no error obtained,

but when I call Aminadistinct(...) through an example; i obtained an error message after the second command:

$g++ -I/usr/local/include/ -c example.cpp
$g++ -L/usr/local/lib/ example.o -lgecodeint -lgecodesearch

example.o: In function `example::example()':
example.cpp:(.text._ZN6exampleC1Ev[example::example()]+0x1e5): undefined reference to `Gecode::Aminadistinct(Gecode::Space&, Gecode::VarArgArray<Gecode::IntVar> const&, Gecode::IntConLevel)'
collect2: ld a retourné 1 code d'état d'exécution

the question is how to compile a new propagator?



Are you sure you provide an implementation for:

Gecode::Aminadistinct(Gecode::Space&, Gecode::VarArgArray<Gecode::IntVar> const&, Gecode::IntConLevel)


The problem can also be the way you link your executable. I think the problem is that you didn't provide an implementation for it or you forgot to link the object file of the propagator when linking your example.

you can try:

$g++ -I/usr/local/include/ -c Aminadistinct.cpp -o Aminadistinct.o
$g++ -I/usr/local/include/ -c example.cpp
$g++ -L/usr/local/lib/ example Aminadistinct.o -lgecodeint - lgecodesearch


Regards,
Gustavo
_______________________________________________
Gecode users mailing list
[email protected]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to