bug-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-glpk] link time errors for GLPK 4.33


From: Andrew Makhorin
Subject: Re: [Bug-glpk] link time errors for GLPK 4.33
Date: Fri, 31 Oct 2008 22:35:20 +0300

Hi Robbie,

> I am having trouble linking against my new build of
> GLPK 4.33.  This is somewhat puzzling as my build
> process is the same as always.  First, my config
> options are:

>   $ ./configure --disable-shared --with-gmp

> After installing, I get:

>   $ glpsol --version
>   GLPSOL: GLPK LP/MIP Solver 4.33

>   $ which glpsol
>   /usr/local/bin/glpsol

> But when I try to link against my application (actually
> a unit test in this case) I find:

>   /usr/local/lib/libglpk.a(glpapi07.o): In function `set_d_eps':
>   /home/robbie/glpk-4.33/src/glpapi07.c:110: undefined reference to 
> `__gmpq_init'
>   /home/robbie/glpk-4.33/src/glpapi07.c:111: undefined reference to 
> `__gmpq_set_d'
>   /home/robbie/glpk-4.33/src/glpapi07.c:112: undefined reference to 
> `__gmpq_set_d'
>   /home/robbie/glpk-4.33/src/glpapi07.c:113: undefined reference to 
> `__gmpq_div'
>   ...
>   /home/robbie/glpk-4.33/src/glplux.c:67: undefined reference to 
> `__gmpq_set_si'
>   collect2: ld returned 1 exit status
>   make: *** [d/siglp] Error 1

> Adding the options "-Wl,--rpath -Wl,/usr/local/lib" to
> the link call makes no difference (as suggested by the
> GLPK install script):

>   $ g++ -Wl,--rpath -Wl,/usr/local/lib -o <object files> <boost libs> -lglpk

> I haven't invested a lot of time in troubleshooting
> because I was hoping there might be a simple
> explanation.

There is nothing unusual. On configuring the glpk package you specified the
option '--with-gmp', so some glpk routines refer to the gnu mp library
routines. This means that on linking your program you should specify both
-lglpk and -lgmp.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]