-------- Forwarded Message --------
From: Eric Anjie Guo <[email protected]>
To: [email protected]
Subject: Trouble Linking with GLPK
Date: Wed, 12 Sep 2012 10:30:46 -0400
Hi All,
Sorry for the spam. I'm learning how to use GLPK, but seem to have
trouble linking with the library.
I compiled with the following command and there seems to be no problem:
gcc -w -I$(CURDIR)/glpk-4.47/include -c sample.c -o sample.o
And the following command was used for linking: (I installed GLPK
at $(CURDIR)/glpk-4.47/)
gcc -w -L$(CURDIR)/glpk-4.47/lib sample.o -lglpk -lm
But when I run ./sample I get the following error message:
./sample: error while loading shared libraries: libglpk.so.0: cannot
open shared object file: No such file or directory
I've also tried linking with the static library by using:
gcc -w -static -L$(CURDIR)/glpk-4.47/lib sample.o -lglpk -lm
But the linkage was failed due to errors such as:
sample.o: In function `main':
sample.c:(.text+0xc): undefined reference to `glp_create_prob'
sample.c:(.text+0x1e): undefined reference to `glp_set_prob_name'
sample.c:(.text+0x2c): undefined reference to `glp_set_obj_dir'
...
I'm working on SDSC Trestles: https://www.xsede.org/sdsc-trestles
I would really appreciate it if anyone could help. Thank you so much!
Best,
Eric
--
Eric Guo, PhD Candidate
School of Operations Research and Information Engineering
288 Rhodes Hall
Cornell University
Ithaca, NY 14850
[email protected]
http://www.orie.cornell.edu/
_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk