2009/4/22 Zhu Liang <[email protected]> > Hi all > > Could you specify how to compile and link sample.c. > > When I try "gcc sample.c /usr/local/lib/libglpk.a -o sample.out", there > comes a lot of linking errors; see below. I remembered I have successfully > compiled and linked it. However, I forgot how I got it..
Try this command: "gcc sample.c /usr/local/lib/libglpk.a -o sample.out -lm" Mingui > > Thanks. > > Liang > > gcc sample.c /usr/local/lib/libglpk.a -o example.out > /usr/local/lib/libglpk.a(glpios03.o): In function `efficacy': > /home/zhuliang/software/glpk-4.36/src/glpios03.c:1768: undefined reference > to `sqrt' > /usr/local/lib/libglpk.a(glpios03.o): In function `parallel': > /home/zhuliang/software/glpk-4.36/src/glpios03.c:1796: undefined reference > to `sqrt' > /usr/local/lib/libglpk.a(glpipm.o): In function `basic_info': > /home/zhuliang/software/glpk-4.36/src/glpipm.c:631: undefined reference to > `sqrt' > /home/zhuliang/software/glpk-4.36/src/glpipm.c:636: undefined reference to > `sqrt' > /home/zhuliang/software/glpk-4.36/src/glpipm.c:645: undefined reference to > `sqrt' > /usr/local/lib/libglpk.a(glpipm.o):/home/zhuliang/software/glpk-4.36/src/glpipm.c:650: > more undefined references to `sqrt' follow > /usr/local/lib/libglpk.a(glpmpl03.o): In function `_glp_mpl_fp_normal01': > /home/zhuliang/software/glpk-4.36/src/glpmpl03.c:374: undefined reference > to `log' > /home/zhuliang/software/glpk-4.36/src/glpmpl03.c:374: undefined reference > to `sqrt' > /usr/local/lib/libglpk.a(glpmpl03.o): In function `_glp_mpl_fp_trunc': > > > > > _______________________________________________ > Help-glpk mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/help-glpk > > -- Mingui Zhang PhD student, Visiting Scholar Gould-Simpson Bldg 1040 E. 4th Street, Computer Science, The University of Arizona, P.O. box: 210077, Tucson AZ 85721 USA Tel:520-621-2759
_______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
