Author Topic: Glade3 problem  (Read 7165 times)

Offline baggio

  • Single posting newcomer
  • *
  • Posts: 4
Glade3 problem
« on: May 27, 2011, 08:49:45 pm »
Hi everyone,
I'm a beginner in Gtk.  really need some help here.
I create a Gtk+ project in codeBlocks, and I encountered this  problem:

  Linking console executable: bin\Debug\test.exe
obj\Debug\main.o: In function `main':
C:/CodeBlocks/project/test/main.c:9: undefined reference to `glade_xml_new'
C:/CodeBlocks/project/test/main.c:10: undefined reference to `glade_xml_signal_autoconnect'
C:/CodeBlocks/project/test/main.c:11: undefined reference to `glade_xml_get_widget'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
3 errors, 0 warnings
.


And my 'Linker seeting'-->'Other linker option's: `pkg-config --cflags  --libs gtk+-2.0 libglade-2.0`


I've been trying to solve  this problem for a long time. I am very anxious to find the answer.who can help me?
Thank you!

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: Glade3 problem
« Reply #1 on: May 27, 2011, 10:06:34 pm »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline baggio

  • Single posting newcomer
  • *
  • Posts: 4
Re: Glade3 problem
« Reply #2 on: May 28, 2011, 07:22:25 am »
Thanks.
I did as you said.But unfortunately, the problem still exists.

my setting is:
complier setting-->other options-->
-mms-bitfields -IC:/Gtk+/include -IC:/Gtk+/include/gtk-2.0 -IC:/Gtk+/lib/gtk-2.0/include
-IC:/Gtk+/include/atk-1.0 -IC:/Gtk+/include/cairo -IC:/Gtk+/include/pango-1.0
-IC:/Gtk+/include/glib-2.0 -IC:/Gtk+/lib/glib-2.0/include -IC:/Gtk+/include/libpng12
-IC:/Gtk+/include/gail-1.0  -IC:/Gtk+/include/gtkglext-1.0  -IC:/Gtk+/include/libglade-2.0
-IC:/Gtk+/include/libgladeui-1.0  -IC:/Gtk+/include/libxml -IC:/Gtk+/lib/gtkglext-1.0/include
-IC:/Gtk+/include/gtkglext-1.0/gdk -IC:/Gtk+/include/glib-2.0 -IC:/Gtk+/bin
-IC:/Gtk+/gtkglext-examples

 linker settings-->other linker options:
`pkg-config --cflags  --libs gtk+-2.0 libglade-2.0`




but it still can't compliing successfully. so why? where is the problem?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Glade3 problem
« Reply #3 on: May 28, 2011, 08:51:11 am »
but it still can't compliing successfully. so why? where is the problem?

Most likely misconfguration and misunderstading of configuration options.

For pkg-config and similar:
use the --cflags (or --cppflags ?) parameter in compiler options and the --libs parameter in the linker settings.

If you really have to specify additional include paths (the most should come from pkg-config --c{pp}flags ) add them to the appropriate search directories in the respective tab.

Full commandline logging shows the full commandline in the build log, so you can see what is sent to the compiler, to be able to fix your problem.
It does not change the commands send to the compiler.

Offline baggio

  • Single posting newcomer
  • *
  • Posts: 4
Re: Glade3 problem
« Reply #4 on: May 28, 2011, 09:53:11 am »
Thank you!Administrator.
I will try that.

Offline baggio

  • Single posting newcomer
  • *
  • Posts: 4
Re: Glade3 problem
« Reply #5 on: May 28, 2011, 10:20:45 am »
Thanks!!!!
I really appreciate your help!!
After browsing the same problem you had settled in three years ago in http://forums.codeblocks.org/index.php?topic=8488.0

I just do as you said Add "glade-2.0" to "Linker Settings -> Link Libraries".

Then it works!
thanks!!