> First I have to thanks you for your aid.  Actually I have always this
> problem that if I use "gcc" to link no problem but not with "g++".

> Case1:    this complie and no problem
> ******************************************************************
> gcc -Wall -O2 -I/usr/include/glpk   -c -o choco.o choco.c
> g++ -L/usr/lib  choco.o  -lglpk -o choco
> *****************************************************************

> BUT
> Case2
> if I use this:
> ***************************************************************
> g++ -Wall -O2 -I/usr/include/glpk   -c -o choco.o choco.c
> g++ -L/usr/lib  choco.o  -lglpk -o choco
> ****************************************************************
> I get  this list of error:
> :main.cpp:(.text+0x741f): undefined reference to 
> `glp_lpx_set_prob_name(LPX*, char*)'
> :main.cpp:(.text+0x742f): undefined reference to
> `glp_lpx_set_obj_dir(LPX*, int)'
> :main.cpp:(.text+0x7441): undefined reference to
> `glp_lpx_set_obj_name(LPX*, char*)'
> ......................................
> :main.cpp:(.text+0x7767): undefined reference to
> `glp_lpx_get_row_prim(LPX*, int)'

> Actually I specify the glpk library by "-lglpk ".

There is something wrong with g++.

The following commands work fine for me (assuming that the current
directory is 'examples'):

g++ -I../include -c -o sample.o sample.c

g++ -L../src/.libs -o sample sample.o -lglpk




_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to