Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Need help linking to external libraries
icon9.gif  Need help linking to external libraries [message #1016769] Thu, 07 March 2013 11:00 Go to next message
Jim Crews is currently offline Jim Crews
Messages: 2
Registered: March 2013
Junior Member
Hello,

Please help a newbie to Eclipse...

I've installed the Eclipse IDE for C/C++ Developers and have successfully created and executed the standard Hello World programs in both C and C++. Now I've installed the GTK+ graphics libraries but cannot get the Internal Builder to link to them. I navigated to the "Project Explorer -> Properties -> C/C++ Build->Settings->Libraries window and used the "File System" option to choose the proper library directory (c:\GTK\lib). I've also verified that all the libraries listed in the libraries(-l) window pane are indeed in that directory.

At this point I've spent literally days trying to figure out what I'm doing wrong. Any help would be very much appreciated.

When I build the program, I get the following output in the console:

10:52:51 **** Incremental Build of configuration Debug for project graphictest ****
Info: Internal Builder is used for build
gcc "-LC:\\GTK\\lib" -o graphictest.exe test.o -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0 -lgio-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lintl
test.o: In function `hello':
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:6: undefined reference to `g_print'
test.o: In function `destroy':
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:12: undefined reference to `gtk_main_quit'
test.o: In function `main':
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:21: undefined reference to `gtk_init_abi_check'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:23: undefined reference to `gtk_window_new'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:24: undefined reference to `gtk_object_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:24: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:24: undefined reference to `gtk_signal_connect_full'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:26: undefined reference to `gtk_container_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:26: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:26: undefined reference to `gtk_container_set_border_width'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:28: undefined reference to `gtk_button_new_with_label'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:30: undefined reference to `gtk_object_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:30: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:30: undefined reference to `gtk_signal_connect_full'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `gtk_object_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `gtk_widget_destroy'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `gtk_object_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:32: undefined reference to `gtk_signal_connect_full'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:35: undefined reference to `gtk_container_get_type'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:35: undefined reference to `g_type_check_instance_cast'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:35: undefined reference to `gtk_container_add'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:36: undefined reference to `gtk_widget_show'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:38: undefined reference to `gtk_widget_show'
C:\Users\Jim\workspaceC\graphictest\Debug/../test.c:40: undefined reference to `gtk_main'
collect2: ld returned 1 exit status

10:52:51 Build Finished (took 192ms)







Re: Need help linking to external libraries [message #1016778 is a reply to message #1016769] Thu, 07 March 2013 11:41 Go to previous messageGo to next message
Russell Bateman is currently offline Russell Bateman
Messages: 3157
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 3/7/2013 9:30 AM, Jim Crews wrote:
> Hello,
>
> Please help a newbie to Eclipse...
>
> I've installed the Eclipse IDE for C/C++ Developers and have
> successfully created and executed the standard Hello World programs in
> both C and C++. Now I've installed the GTK+ graphics libraries but
> cannot get the Internal Builder to link to them. I navigated to the
> "Project Explorer -> Properties -> C/C++ Build->Settings->Libraries
> window and used the "File System" option to choose the proper library
> directory (c:\GTK\lib). I've also verified that all the libraries
> listed in the libraries(-l) window pane are indeed in that directory.
>
> At this point I've spent literally days trying to figure out what I'm
> doing wrong. Any help would be very much appreciated.
>
> [snip]

As suggested by the sticky posts you should have read at the top of this
forum, please ask questions on using Eclipse for C/C++ in the Eclipse
CDT forum. You might very well never get an answer here.
Re: Need help linking to external libraries [message #1016781 is a reply to message #1016778] Thu, 07 March 2013 11:48 Go to previous message
Jim Crews is currently offline Jim Crews
Messages: 2
Registered: March 2013
Junior Member
Thank you. Being the newbie I am I wasn't sure if a linking issue involved CDT or the general platform. I'll try the other forum.
Previous Topic:Can run Eclipse on windows RT?
Next Topic:java & C++ plug ins
Goto Forum:
  


Current Time: Sat Aug 30 02:27:06 EDT 2014

Powered by FUDForum. Page generated in 0.05086 seconds