Undefined reference to `gdk_color_parse'

497 views Asked by At

I'm using GTK + 3.0 Lib, and I'm getting errors:

Undefined reference to `gdk_color_parse'

My source code:

int
connectPS3(GtkWidget *button)
{
    HINSTANCE   hLib;
    hLib = LoadLibrary("CCAPI.DLL");

    gchar   *ip;
    ip = "192.168.0.40";

     __cConnect v_connectPS3 = GetProcAddress(hLib, "CCAPIConnectConsole");
    __cNotify v_notifyPS3 = GetProcAddress(hLib, "CCAPIVshNotify");

    GdkColor    color;

    if (v_connectPS3(ip) == 0)
    {
        v_notifyPS3(TROPHY2, "Connected to PS3");
        gtk_button_set_label(GTK_BUTTON(button), "Connected");
        gdk_color_parse("green", &color);
        gtk_widget_modify_bg(button, GTK_STATE_NORMAL, &color);
    }
    else
    {
        gtk_button_set_label(GTK_BUTTON(button), "Can't connect to IP Address");
        gdk_color_parse("red", &color);
        gtk_widget_modify_bg(button, GTK_STATE_NORMAL, &color);
    }

    return (0);
}

So if someone can tell me why I'm getting that, I'll be thankful.

I have no linker settings.

1

There are 1 answers

0
Sourav Ghosh On BEST ANSWER

As per this previous answer, it looks like there is some change required in your compilation statement.

However, in general, please check the below points,

  1. All the libraries which are used (required) should be linked with.
  2. The order of appearance of libraries matter, so re-check the order in regards to the dependency.