c++ - Gtkmm program compiles fine but crashes - windows XP -


i have installed gtkmm (gtkmm-2.4)

when compile g++ use following information pkg-config

headerfiles

pkg-config gtkmm-2.4 --cflags 

objectfiles

pkg-config gtkmm-2.4 --libs 

so compile simple helloworld problam show window on screen ...

g++ gtkmm_app2.cpp -o gtkmm_app2 `pkg-config gtkmm-2.4 --cflags --libs` 

it compiles fine when execute program chrashes. following information:

an unhandled win32 exception occurred in gtkmm_app2.exe[5364]

i not exert on debugging when redirected visual studio problems seems point dll-file:

 libglibmm-2.4-1.dll 

information versions , platforms

compiler:

gnu c++ compiler: 3.4.5-20060117-3 gnu c++ compiler runtime library: 4.7.2-1 

os:

 windows xp home edition 2002 (sevice pack 3) 

so question: have no idea problems depends on? version of mingw? or operating system causing problem? can compile , execute without problems using gtk3 on c-apps, not gtkmm c++. ideas how solve problem(s)? extremely helpful this!!!

==========================================================================

the call stack

libglibmm-2.4-1.dll!6652ea89() // points here .. libglibmm-2.4-1.dll!664de158()   msvcrt.dll!77c2a52e()    msvcrt.dll!77c29d60()    msvcrt.dll!77c24e2f()    msvcrt.dll!77c24e42()    libgtkmm-2.4-1.dll!0069004d()    libgtkmm-2.4-1.dll!005f0073()    

and output in consolewindow: seems kind if heapcorruption or segmentation fault:

'gtkmm_app2.exe': loaded 'c:\cygwin\home\Ägaren\gtkmm_app2.exe', binary not built  debug information. 'gtkmm_app2.exe': loaded 'c:\windows\system32\ntdll.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\kernel32.dll', cannot find or open  pdb file 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libglibmm-2.4-1.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libglib-2.0-0.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\intl.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\windows\system32\advapi32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\rpcrt4.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\secur32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\msvcrt.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\ole32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\gdi32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\user32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\shell32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\shlwapi.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\ws2_32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\ws2help.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libgmodule-2.0-0.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libgobject-2.0-0.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libgthread-2.0-0.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libsigc-2.0-0.dll', binary not built debug information. 'gtkmm_app2.exe': loaded 'c:\gtkmm\bin\libgcc_s_sjlj-1.dll', binary not built debug information.  ......   'gtkmm_app2.exe': loaded 'c:\windows\system32\lpk.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.6028_x-ww_61e65202\comctl32.dll', cannot find or open pdb file 'gtkmm_app2.exe': loaded 'c:\windows\system32\apphelp.dll', cannot find or open pdb file unhandled exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. first-chance exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. unhandled exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. first-chance exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. unhandled exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. first-chance exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation   writing location 0x00405068. unhandled exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. first-chance exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation writing location 0x00405068. ....... unhandled exception @ 0x6652ea89 in gtkmm_app2.exe: 0xc0000005: access violation  program '[5596] gtkmm_app2.exe: native' has exited code 0 (0x0). 

edit: succeeded in compiling , execute app vc++ (visual studio 2010) must mingw responsible crash. know cause problem , how solve it.

edit2: after recompiling debug support got info in cygwing terminalwindow

c:\cygwin\tmp\ccik3n1q.o: in function `main': c:\cygwin\home\▒garen/gtkmm_app.cpp:5: undefined reference `gtk::main::main(int&,  char**&, bool)' c:\cygwin\home\▒garen/gtkmm_app.cpp:7: undefined reference   `gtk::window::window(gtk::windowtype)' c:\cygwin\home\▒garen/gtkmm_app.cpp:9: undefined reference  `gtk::main::run(gtk::window&)' c:\cygwin\home\▒garen/gtkmm_app.cpp:11: undefined reference `gtk::window::~window()' c:\cygwin\home\▒garen/gtkmm_app.cpp:11: undefined reference `gtk::main::~main()' c:\cygwin\home\▒garen/gtkmm_app.cpp:11: undefined reference `gtk::window::~window()' c:\cygwin\home\▒garen/gtkmm_app.cpp:11: undefined reference `gtk::main::~main()' c:\cygwin\tmp\ccik3n1q.o: in function `_tcf_0': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:41: undefined reference  `glib::ustring::~ustring()' c:\cygwin\tmp\ccik3n1q.o: in function `_tcf_1': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:42: undefined reference  `glib::ustring::~ustring()' c:\cygwin\tmp\ccik3n1q.o: in function `_tcf_2': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:43: undefined reference `glib::ustring::~ustring()' c:\cygwin\tmp\ccik3n1q.o: in function `_tcf_3': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:44: undefined reference `glib::ustring::~ustring()' c:\cygwin\tmp\ccik3n1q.o: in function `_tcf_4': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:45: undefined reference `glib::ustring::~ustring()' c:\cygwin\tmp\ccik3n1q.o:c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:46: more undefined references `glib::ustring::~ustring()' follow c:\cygwin\tmp\ccik3n1q.o: in function `_static_initialization_and_destruction_0': c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:41: undefined reference  `glib::ustring::ustring(char const*)' c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:42: undefined reference `glib::ustring::ustring(char const*)' c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:43: undefined reference `glib::ustring::ustring(char const*)' c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:44: undefined reference `glib::ustring::ustring(char const*)' c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:45: undefined reference `glib::ustring::ustring(char const*)' c:\cygwin\tmp\ccik3n1q.o:c:/gtkmm/include/gtkmm-2.4/gtkmm/papersize.h:46: more   undefined references `glib::ustring::ustring(char const*)' follow collect2.exe: error: ld returned 1 exit status` 

as mentioned in first edit can compile , execute vc++ in visual studio 2010 without problem. problem then?

now see debug output, believe problem order of compile flags. try:

g++ -wall -g `pkg-config --cflags gtkmm-2.4` gtkmm_app2.cpp -o gtkmm_app2 `pkg-config --libs gtkmm-2.4` 

the syntax:

`pkg-config gtkmm-2.4 --cflags --libs` 

should not used. it'll compile not link external gtkmm libraries.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -