I have tried to build a gtk+2.0 gladeui app on WindowsXP mingw32 with gcc 4.8.1 installed (latest).
Source with build script attached. The following output shows the problem:

-----------------------------------------------------------------------------------------------------------------------
main.c: In function `main':
main.c:26: warning: assignment from incompatible pointer type
f:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../mingw32/lib/crt2.o: In function `_mingw_setargv':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/crt/init
.c:111: undefined reference to `__chkstk_ms'
f:/mingw/lib/libmingwex.a(glob.o): In function `glob_match':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/misc/glo
b.c:733: undefined reference to `__chkstk_ms'
f:/mingw/lib/libmingwex.a(glob.o): In function `glob_strdup':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/misc/glo
b.c:85: undefined reference to `__chkstk_ms'
f:/mingw/lib/libmingwex.a(glob.o): In function `glob_match':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/misc/glo
b.c:841: undefined reference to `__chkstk_ms'
f:/mingw/lib/libmingwex.a(glob.o): In function `glob_strdup':
e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3-1-mingw32-src/src/libcrt/misc/glo
b.c:85: undefined reference to `__chkstk_ms'
f:/mingw/lib/libmingwex.a(glob.o):e:\p\giaw\src\pkg\mingwrt-4.0.3-1-mingw32-src\bld/../mingwrt-4.0.3
-1-mingw32-src/src/libcrt/misc/glob.c:85: more undefined references to `__chkstk_ms' follow
collect2: ld returned 1 exit status
-------------------------------------------------------------------------------------------------------------------------


I have found that in my instalation path *f:\mingw\lib\gcc\mingw32\* two directories named: *3.4.5* and *4.8.1*.

I have found that string */lib/gcc/mingw32/3.4.5* placed in *f:\mingw\bin\libidn-11.dll* and
*f:\mingw\lib\libidn.a* files.

Conclusion (IMHO): Looks like *mingw* and *libidn* related problem in return parts of wrapers, because they just return
hard-coded string while linking executable.

However, I copied files from the folder *4.8.1* to *3.4.5* having owerwrite an older.
The problem with *undefined reference to `**__chkstk_ms**'* has gone. :)

Related problem occurrence:
http://stackoverflow.com/questions/18649173/how-to-solve-undefined-reference-to-chkstk-ms-on-mingw/19716737#19716737
With regards, Главные Редакторы.


printf "*** compilling ***\n"
gcc -o glade-template main.c `pkg-config --cflags gtk+-win32-2.0 --libs 
gtk+-win32-2.0 gladeui-1.0`
#gcc -o glade-template main.c -mno-cygwin -mms-bitfields `pkg-config --cflags 
gtk+-win32-2.0 --libs gtk+-win32-2.0 gladeui-1.0`
#g++ -o glade-template main.c -mno-cygwin -mms-bitfields `pkg-config --cflags 
gtk+-win32-2.0 --libs gtk+-win32-2.0 gladeui-1.0`
printf "*** converting to gtk builder ***\n"
gtk-builder-convert main-window.glade main-window
printf "*** start ***\n"
./glade-template.exe &
printf "*** done ***\n"
#include <gtk/gtk.h>
#include <gladeui/glade.h>
#include <glib.h>
#include <stdlib.h>
#include <windows.h>

gint delete_event (GtkWidget* widget, GdkEvent* event);

int main (int argc, char* argv[])
{
	g_type_init ();
	GtkWidget* widget;
	GtkBuilder* ui = gtk_builder_new ();
	GError* error = NULL;

	gtk_init (NULL, NULL);
			
	if (!gtk_builder_add_from_file (ui, "main-window", &error))
	{
		g_warning ("Couldn't load builder file: %s", error->message);
		g_error_free (error);
		exit (1);
	}

	widget = gtk_builder_get_object (ui, "window1");
	gtk_signal_connect (GTK_OBJECT (widget), "delete_event", GTK_SIGNAL_FUNC (delete_event), (gpointer) NULL);
	
	gtk_widget_show_all (widget);
		
	gtk_main();
	
	return 0;
}

gint delete_event (GtkWidget* widget, GdkEvent* event)
{
	gtk_main_quit ();
	return 1;
}

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
<!--Generated with glade3 3.4.3 on Tue May 10 08:32:28 2011 -->
<glade-interface>
  <widget class="GtkDialog" id="window1">
    <property name="border_width">5</property>
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
    <property name="default_width">300</property>
    <property name="default_height">200</property>
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
    <child internal-child="vbox">
      <widget class="GtkVBox" id="dialog-vbox1">
        <property name="visible">True</property>
        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
        <property name="spacing">2</property>
        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
        <child>
          <widget class="GtkTextView" id="textview1">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="wrap_mode">GTK_WRAP_WORD</property>
          </widget>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
        <child internal-child="action_area">
          <widget class="GtkHButtonBox" id="dialog-action_area1">
            <property name="visible">True</property>
            <property name="layout_style">GTK_BUTTONBOX_END</property>
            <child>
              <placeholder/>
            </child>
            <child>
              <widget class="GtkButton" id="button1">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">button</property>
                <property name="response_id">0</property>
              </widget>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">1</property>
              </packing>
            </child>
          </widget>
          <packing>
            <property name="expand">False</property>
            <property name="pack_type">GTK_PACK_END</property>
          </packing>
        </child>
      </widget>
    </child>
  </widget>
</glade-interface>
<?xml version="1.0" ?><!--Generated with glade3 3.4.3 on Tue May 10 08:32:28 2011 --><interface>
  <object class="GtkDialog" id="window1">
    <property name="border_width">5</property>
    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
    <property name="default_width">300</property>
    <property name="default_height">200</property>
    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
    <child internal-child="vbox">
      <object class="GtkVBox" id="dialog-vbox1">
        <property name="visible">True</property>
        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
        <property name="spacing">2</property>
        <property name="orientation">GTK_ORIENTATION_VERTICAL</property>
        <child>
          <object class="GtkTextView" id="textview1">
            <property name="visible">True</property>
            <property name="can_focus">True</property>
            <property name="wrap_mode">GTK_WRAP_WORD</property>
          </object>
          <packing>
            <property name="position">1</property>
          </packing>
        </child>
        <child internal-child="action_area">
          <object class="GtkHButtonBox" id="dialog-action_area1">
            <property name="visible">True</property>
            <property name="layout_style">GTK_BUTTONBOX_END</property>
            <child>
              <placeholder/>
            </child>
            <child>
              <object class="GtkButton" id="button1">
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="label" translatable="yes">button</property>
                
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">False</property>
                <property name="position">1</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="pack_type">GTK_PACK_END</property>
          </packing>
        </child>
      </object>
    </child>
  <action-widgets><action-widget response="0">button1</action-widget></action-widgets></object>
</interface>
_______________________________________________
Help-libidn mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-libidn

Reply via email to