LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Eclipse c++ gui development (https://www.linuxquestions.org/questions/programming-9/eclipse-c-gui-development-4175470713/)

Larry James 07-25-2013 05:55 PM

Thank you, Dugan and A4z for your attention and contribution to my resolution.

I appreciate how you so carefully explained that there was nothing to it but ensuring proper configuration.

After very carefully studying the errors, after providing the list to A4z, I went to the properties setting over and over adding a directory that included the file that it couldn't find. Before I was adding the file's full path to an include directive in the source. But adding the directory that included the file was the key. I added about 5 addition directories.

It was also crucial to have this entry as part of the commandline:
Code:

$(`pkg-config --libs --cflags gtk+-2.0`)
The code that works is:

Code:

#include "/usr/include/gtk-2.0/gtk/gtk.h"
#include "/usr/include/glib-2.0/glib-object.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);
}


I'm sure that since I have a working example I'll be able to work out the problems with the others that doesn't work.

Cheers to the resource of LQ and all the enthusiastic users helping and contributing to the community.

Have a nice day!

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

a4z 07-26-2013 12:45 AM

great to read that you have some success.

if you add

/usr/include/gtk-2.0/gtk
/usr/include/glib-2.0/

to your include directories than you can change your code to

#include <gtk.h>
#include <glib-object.h>

as it should be, since using absolut path for #include is not the best solution because on an other machine those files could be somewhere else.

Larry James 07-26-2013 12:51 AM

Quote:

Originally Posted by a4z (Post 4997002)
great to read that you have some success.

if you add

/usr/include/gtk-2.0/gtk
/usr/include/glib-2.0/

to your include directories than you can change your code to

#include <gtk.h>
#include <glib-object.h>

as it should be, since using absolut path for #include is not the best solution because on an other machine those files could be somewhere else.

Thanks. I soon leaned exactly what you were mentioning. Everything was still a blur when I posted my immediate success. But it's all coming together now.

I went from gtk-2.0, to gtk-3.0, and now I'm at gtkmm3.0.

I was also having some confusion because most of the examples I was finding were all in C instead of C++. I believe I'm learning the gtk+-3.0 was the transition from C to C++ and gtkmm is the transition completed.

I'm in the gtkmm tutorials at this point.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames


All times are GMT -5. The time now is 07:38 PM.