[Top][All Lists]

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

Re: [Help-glpk] Help on using GLPK 4.9 in MS VC++ 6.0

From: Andrew Makhorin
Subject: Re: [Help-glpk] Help on using GLPK 4.9 in MS VC++ 6.0
Date: Mon, 3 Apr 2006 12:22:52 +0400

Hi Woei Ling,

To compile glpk with msvc++ 6.0 from scratch you should do the

1. Download the tarball glpk-4.9.tar.gz (i.e. the most recent
version) either from the official GNU ftp site:
or from some mirror ftp sites; see .

2. Unzip and untar the glpk distribution using an appropriate
utility like WinZip or WinRar.

3. Enter the subdirectory (folder) where glpk files are placed
(i.e. make it the current directory) and run the following command
in the command-line mode:

   nmake /f w32vc6.mak

(If you see the message "Bad command or file name", some
environment variables used by msvc are not set properly. To set
them find and run the file vcvars32.bat which is usually placed
in C:\Program Files\MicrosoftVisual Studio\VC98\Bin).

To simplify this step, esp. under winxp, I'd recommend you to
create the following batch file (named, say, foo.bat) in the glpk

   call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat"
   nmake /f w32vc6.mak

It can be run just by double-clicking the mouse.

4. Make sure that the compilation is successful running the
following command:

   nmake /f w32vc6.mak check

As a result of the compilation there must be two files created
in the glpk subdirectory: glpk.lib (the glpk object library) and
glpsol.exe (the stand-alone solver utility).

5. In msvc ide you should add to your project the subdirectory
'include' which contains all glpk headers and the object library
glpk.lib created on step 3.

6. To make sure that all is working compile and run the small
example program 'sample.c' placed in the subdirectory 'ex'.

Hope this will help you.

Andrew Makhorin

reply via email to

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