help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] RE: sample.c


From: Нестеренко Геннадий Витальевич
Subject: [Help-glpk] RE: sample.c
Date: Wed, 4 Aug 2010 17:40:07 +0400


> > > >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.


Sorry..
Matteo answered me too, but he done it by direct e-mail.
I think I know what's the matter now



> 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 suppose you are right. There isn't file libglpk.a on my computer 'cos I never 
make .exe files linking glpk-sources


> 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
> 




reply via email to

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