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. _______________________________________________ Bug-glpk mailing list Bug-glpk@gnu.org http://lists.gnu.org/mailman/listinfo/bug-glpk