help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] [Fwd: Trouble Linking with GLPK]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: Trouble Linking with GLPK]
Date: Wed, 12 Sep 2012 21:41:16 +0400

-------- Forwarded Message --------
From: Eric Anjie Guo <address@hidden>
To: address@hidden
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

address@hidden
http://www.orie.cornell.edu/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]