Hello Erik,

your mail had to be forwarded manually because you are not a member of the GLPK 
help list, see
https://lists.gnu.org/mailman/listinfo/help-glpk

Take a look at
http://www.eyrie.org/~eagle/notes/rpath.html
http://www.wiredrevolution.com/system-administration/how-to-correctly-use-ld_library_path

Best regards

Xypron

> -------- Forwarded Message --------
> From: Eric Anjie Guo <[email protected]>
> 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

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

Reply via email to