Re: hello world



On Saturday 14 October 2006 16:22, David Nečas wrote:
> On Fri, Oct 13, 2006 at 10:48:01PM -0400, Bill Cunningham wrote:
> >     Looking at the tutorial it looks like one needs to create a symlink
> > with the headers in usr/local/include and usr/include for gtk's headers.
>
> No, one does not.  It can be compiled exactly as stated.
> I don't know (but wonder) why nothing ever works on your
> system...
>
> > Also to
> > compile something simple do alot of macros need to be defined at compile
> > time when the compiler is ran or can macros be defined in a header and
> > run through the preprocessor before the compile generates assembly?
>
> You do not to define any lots of macros to #include Gtk+
> headers.  What exactly you are talking about?

I think the problem is that he is new to compiling stuff and by an ill-advised 
copying of directories around, and other fiddling, in his attempts to compile 
GTK+-2 and its dependencies for an old version of Red Hat which does not come 
with GTK+-2, he has managed to pretty well bollox up his system.  He has 
displayed remarkable stamina however.

Bill, I suggest you:

1.  Uninstall everything that you have put together in installing GTK+-2 and 
its dependencies and start again as below.

2.  Put /usr/local/lib/pkgconfig in your PKG_CONFIG_PATH environmental 
variable - as a temporary expedient for a bash terminal in which you are 
doing your compiling you can just do:
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
before running ./configure.

3.  Add /usr/local/lib to /etc/ld.so.conf.

4.  In the correct build order just do:
  ./configure
  make
  make install (this one as root)
  ldconfig (also as root - running ldconfig is for safety's sake although make
  install should do this for you automatically)
for each library to be compiled and installed in order to put together your 
GTK+ installation (that is, which does not come with your distribution).

I can guarantee that if you do this that (a) GTK+ and its dependencies will 
install correctly, in the /usr/local prefix (b) you will be able to compile 
your "hello world" program correctly from this installation (assuming that 
the code itself is correct and you use pkg-config to provide CFLAGS and 
LIBS/LDFLAGS).  Make sure however before you compile a GTK+ dependency in 
this way, that it is not previously installed via your system package 
manager, which by default will be in the /usr prefix (I think you are using 
an old version of Red Hat, so check with rpm what you have installed) - 
otherwise you may have two different versions installed (one in /usr and one 
in /usr/local) which will probably in due course cause you difficulties, and 
may indeed be the cause of your present difficulties.

If this doesn't work then you must have left some old stuff around from your 
previous attempts and/or failed to detect previously installed version(s) 
installed via your package manager.

Chris




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