help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] link glpk with borland c++


From: Andrew Makhorin
Subject: Re: [Help-glpk] link glpk with borland c++
Date: Wed, 24 May 2006 10:50:47 +0400

> I compiled an example from refman.pdf. It worked well. But when I
> ran the .exe file, it gave no result and the WinXP gave a warning. I
> traced back, start from runing the 'make all' menu in bc5 and it
> gave me comments:
> 
> Building...
> Compiling c:\bc5\bin\sample-1.cpp
> Linking c:\bc5\bin\sample-1.cpp
> Error: Unresolved external 'glp_lpx_create_prob()' referenced from
> c:\bc5\bin\sample-1.obj
> ...
>
> Any suggestion?
> 1. I opened project options in bc5 to make links with include and
> lib in glpk directory or
> 2. I copied contents both subdirectories and pasted into include and
> lib in bc5.
> Both cases gave the same error

You need to do the following:

1. Compile glpk with bc5. Easiest way to do that is using the
makefile w32bc5.mak included in the distribution: enter the
subdirectory (to make it current) where the makefile is placed and
run the command 'make -f w32bc5.mak' either from 'ms-dos prompt'
window or from command-line. This will produce glpk.lib, a static
library containig all glpk routines, in the same subdirectory. To make
sure that all is ok run the command 'make -f w32bc5.mak check'.

2. If you are using ide, specify through 'Edit local options...'
for corresponding project node a path to glpk 'include' directory
and add the static library glpk.lib built on step 1 to that node.
Do not copy anything to bc5 directory.

3. The example given in the reference manual can be found in file
glpk-4.10\examples\sample.c'. Use it to build a test project.

4. Note that glpk is written in C, not in C++. So if you do not
intend write your code in C++, use '.c' extension rather than '.cpp'.





reply via email to

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