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

Posted on 2007-07-21
Last Modified: 2013-11-15
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

#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;
Question by:Oscurochu
    LVL 43

    Accepted Solution

    make sure libXft-devel package is installed.
    LVL 5

    Author Comment

    It compiles without error now, but when I try to run it, I get this error:

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
    The viewer will learn how to successfully download and install the SARDU utility on Windows 7, without downloading adware.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now