help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] using Dev-C++


From: Andrew Makhorin
Subject: Re: [Help-glpk] using Dev-C++
Date: Fri, 26 May 2006 00:11:30 +0400

> I tried to use Dev-C++ and made a project Project1 which consists of:
> glpk.lib
> sample.c

Dev-C++ is based on gcc and uses .a, not .lib; from where did you
obtain that precompiled library? If it was not produced by Dev-C++,
it is useless in this case.

> 
> I added in Project options 'Directories'
> a path to Library Directories: E:\GnuWin32\lib and
> a path to Include Directories: E:\GnuWin32\include
> 
> But when I set: 
> 
> 1. Project options 'Files',
> only for sample.c, I selected 'Include in compilation' and 'Include in
> linking'
> Errors are:
>   [Linker error] undefined reference to `glp_lpx_create_prob' 
>   [Linker error] undefined reference to `glp_lpx_set_prob_name' 
> ..
>   ld returned 1 exit status 
>  C:\Dev-Cpp\Examples\Makefile.win [Build Error]  [Project1.exe] Error 1 
> 
> 
> 2. Project options 'Files',
> for glpk.lib, I selected 'Include in compilation' and 'Include in linking'
> for sample.c, I did the same as above
> Errors are:
>  C:\Dev-Cpp\Examples\Makefile.win [Build Error] 
> [E:/ErwinPritanto/GnuWin32/lib/glpk.o] Error 255
> 
> 
> 3. Project options 'Files', no change  
> Errors are:
>  C:\Dev-Cpp\Examples\Makefile.win [Build Error]  [Project1.exe] Error 1 
> 
> 
> I thought that I made wrong Project Options. Could someone help me which
> parts
> of Project options
> have to be changed, added etc.

You need to do the following:

(1) Add 'sample.c' to the project.

(2) Specify the glpk include directory in 'Project Options/Directories/
    Include Directories'

(3) Specify the glpk static library 'glpk.a' in 'Project Options/
    Parameters/Linker' using the button 'Add Library or Object'.

Then all will work.

I successfully compiled glpk 4.10 with Dev-C++ 4.9.9.2; so if you need
the library 'glpk.a', I can post it to you.

Andrew Makhorin





reply via email to

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