[Top][All Lists]

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

Re: [Help-glpk] GLPK with Code::Blocks

From: vijay patil
Subject: Re: [Help-glpk] GLPK with Code::Blocks
Date: Fri, 27 Jun 2008 20:24:43 +0530

On 6/25/08, address@hidden <address@hidden> wrote:
> Dear all,
> I am working in C++ using Code::Blocks (under Windows) and I am trying to
> get GLPK to run. I could only find information for other software, not for
> Code::Blocks so I hope that someone could help me out...
> I just need the sample.c file to work :)
> I have downloaded GNUWin32, latest version, and installed everything on my
> computer (glpsol works fine). I linked to the /include directory and added
> the code:

I assume that you have a valid glpk static library for Windows
available with you. Something like libglpk.lib. If not you could
download the GLPK source code and build static library yourselves.

> The (first) error I get is:
> obj\Release\test.o:test.c:(.text+0x21)||undefined reference to
> `_glp_create_prob'|

Looks like your application (test.c) is not able to link to GLPK
library. Try this in Code::Blocks. In project tree you probably have a
project Sample/Test under workspace.

1. Right click on the project. Select "Build Options" from the menu.

2. Project build options page will appear. Select Debug or Release
target as you wish.

3. Now you could like to define settings.

4. Select "Linker Settings". Left hand side has a place for "Link Libraries"

5. Click Add. Specify complete path of glpk library, which you already
have. Something like :
C:\Documents and Settings\vijay\My Documents\My Projects\libglpk\libglpk.lib;

If necessary edit other options as necessary, click OK and hit build,
and hopefully it will go fine.

Vijay Patil

reply via email to

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