Re: GTK static compile



On 11/23/06, getik too <getik2 inbox com> wrote:
I was told that compiling statically will enable my gtk program to run on any
system with the same OS as the original compiling OS whether or not GTK is
present.
I tried this by typing gcc -static -o outputfile file.c `pkg-config --cflags
--libs gtk+-2.0` and I got this error
/usr/bin/ld: cannot find -lgtk-x11-2.0
collect2: ld returned 1 exit status

What do I do now.  I read a suggestion that I look for static libraries of
GTK which are not installed automatically.  If this is true how can I check
if I do have these static libraries and if I dont where do I get them and how
do I install them.
Static libraries come in "*.a" archives, you may try to search for
them in your current distro. There may be another possible problems
with a static linking, not only technical (like LGPL license that
requires the possibility to relink with different libraries version)

If there is another way to get my app to run on a computer that does not have
GTK or maybe an earlier version than that used for my app let me know thanks.
You can provide dynamic GTK binaries with your program and use smth
like LD_LIBRARY_PATH pointing to them.

  Olexiy



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