Re: [gtk-list] Re: how do i compile?



ryo wrote:
> 
> I am using redhat 5.0 linux, if I suppress the -lsocket flag, the program
> (hello.cc) compile, but there is an error when I execute it :
> 
> ./hello: error in loading shared libraries
> libgtkmm.so.0: cannot open shared object file: No such file or directory
> 
> So the question is : "what are  the commands to compile classes or
> programs with gtk-- under linux (red hat 5.0) with i386 machines?"
> 
> Bye bye
> -------------------------------------------------------
>  Pierre Loubigniac
> -------------------------------------------------------
> 
> On Thu, 19 Feb 1998, Peter Norton wrote:
> 
> > On Thu, Feb 19, 1998 at 08:34:45PM +0000, ryo wrote:
> > > That's better, but not great though :)
> > >
> > > now I have got this command now :
> > >
> > > g++  -I/usr/local/include -L/usr/X11R6/lib/ -o $1 $1'.cc' -lgtkmm -lgtk -lgdk
> > >  -lglib -lXext -lX11 -lm -lsocket -lnsl
> >
> > Are you running on solaris or linux?  At least w/ libc5 the stuff that's
> > in the solaris libsocket.so is covered in libc iteself.
> >
> > -Peter
> >
	People has responded the right way to compile:

g++  -I/usr/local/include -L/usr/X11R6/lib/ -o $1 $1'.cc' -lgtkmm -lgtk
-lgdk -lglib -lXext -lX11 -lm

	This will compile if you did make install in gtk--. If you did this,
you will have a libgtkmm.so???? in somewhere (probably /usr/local/lib).
	You say the program compiles ok. Then the problem is that at execution
time the linker doesn´t find the library. You have to add the directory
where the library file is to your /etc/ld.so.conf file or
LD_LIBRARY_PATH enviroment variable.


-- 
+--------------------------+---------------------------+
|David Abilleira Freijeiro | Pontevedra, España        |
+--------------------------+---------------------------+
|http://members.xoom.com/odaf   (mailto:odaf@nexo.es)  |
|    (UNED, Mis Programas, Linux, Programación, etc.)  |
+------------------------------------------------------+



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