help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] RE: sample.c


From: Nigel Galloway
Subject: Re: [Help-glpk] RE: sample.c
Date: Wed, 4 Aug 2010 14:44:39 +0100

Have you compiled glpk using mingw?

When you do that successfully you will have two files glpk4_44.dll and 
libglpk4_44.a

When you have these copy them both into the same directory as sample.c and use 
-lglpk4_44

When this works move the dll and the archive to a safe_place and try 
-Lsafe_place -lglpk4_44

To actually run sample.exe glpk4_44.dll will need to be somewhere on your 
windows library path. The same direstory as sample.exe is a ok but becomes 
inconvinient after a while. C:\Windows\System is good.

> ----- Original Message -----
> From: "Rios, Joseph L. (ARC-AFO)" <address@hidden>
> To: "address@hidden" <address@hidden>
> Subject: [Help-glpk] RE: sample.c
> Date: Wed, 4 Aug 2010 07:14:42 -0500
> 
> 
> 
> 
> > > >C:\xrcs>E:\Dev-Cpp\bin\gcc -LC:\xrcs\glpk-4.44 sample.o -lglpk -lm
> > > >
> > > >gives an error
> > > >
> > > >E:\Dev-
> > > Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot
> > > find -lglpk
> > > >collect2: ld returned 1 exit status
> > > >
> > > >What's wrong?
> > >
> > > I don't use Windows, but I'd try checking your Library path.  If I'm
> > > not mistaken, the GLPK library is built into the src directory.  Try
> > > this as your library path flag:
> > >
> > > -LC:\xrcs\glpk-4.44\src
> > >
> > > Let us know how it goes.
> > >
> >
> > I've tried. It's the same result.
> 
> 
> >>
> >> Let us know how it goes.
> >>
> 
> > I've tried. It's the same result.
> 
> Well, no one else is chiming in, so I guess you are stuck with me.  
> Maybe a Windows user will help out?
> 
> Have you actually installed glpk?  If so, the library should be in 
> a default location and ready to be linked against.  If you haven't 
> done a 'make install' for GLPK, I'd recommend you try that next and 
> then figure out where the library file goes (is it a .dll for 
> Windows?).  You shouldn't even need a -L flag if the library is 
> installed in a default location, though you can supply one anyway 
> if you know where the installed library lives.
> 
>  From the GLPK manual:
> 
> If the library is installed in the default location /usr/local/lib, the
> following typical command may be used to link, say, the example C program
> described above against with the library:
> $ gcc sample.o -lglpk -lm
> If the GLPK library is not in the default location, the corresponding
> directory containing it should be made known to the linker through -L
> option, for example:
> $ gcc -L/foo/bar/glpk-4.15 sample.o -lglpk -lm
> 
> 
> 
> Keep us posted.
> 
> Joey
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk

>


-- 
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com




reply via email to

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