help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] compile e execute


From: Andrew Makhorin
Subject: Re: [Help-glpk] compile e execute
Date: Fri, 13 Apr 2001 00:49:39 +0400

>I read the GLPK User's Guide. But I don't understand how to compile and
>execute the file sample.c; typed in prompt of Linux:
>#gcc sample.c -o sample
>And received this error message:
>collect 2: ld return 1 exit status
>Thanks.
>Carlos A. S. de Andrade
>address@hidden



If you have installed GLPK (see the file 'INSTALL' for details), you
can enter the following command:

gcc sample.c -lglpk -lm

which by default produces the executable 'a.out' (it can be run by the
command './a.out').

Alternatively, you can just compile the package (i.e. use 'make' or
'make check' instead 'make install'). In this case you need explicitly
specify the subdirectory which contains GLPK headers, and the GLPK
object library, for example:

gcc sample.c -I glpk-x.y/include glpk-x.y/libglpk.a -lm

Be sure that you have got GLPK 2.3 which is the latest version of the
package.

Best regards,

Andrew Makhorin






reply via email to

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