[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2332
  • Last Modified:

usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -lXft

I'm new to programming. I've created a few simple programs on linux, but was never able to create a simple gui on windows. I have installed all of the libraries that cygwin was complaining about... now I get this error:

Jason@jason /cygdrive/c/Documents and Settings/Jason/Desktop
$ gcc base.c -o base `pkg-config --cflags --libs gtk+-2.0`
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find
collect2: ld returned 1 exit status

Here is the source code (example code from gtk.org):

#include <gtk/gtk.h>

int main( int   argc,
          char *argv[] )
    GtkWidget *window;
    gtk_init (&argc, &argv);
    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);
    gtk_main ();
    return 0;
1 Solution
make sure libXft-devel package is installed.
OscurochuAuthor Commented:
It compiles without error now, but when I try to run it, I get this error:

(base:5344): Gtk-WARNING **: cannot open display:

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now