GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Wed Jul 01, 2015 11:13 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: gtkmm[2/3] with C++11 support (win32)
PostPosted: Fri Mar 27, 2015 6:52 pm 
Offline
Never Seen the Sunlight

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 316
Location: Fortress of solitude
Hi, people...I'm trying new things and I wonder if someone already make executables using gtkmm[2/3] version with C++11 support on windows platform. I know in linux works..I already tested...but in windows I have this mingw32 version and this gtkmm version and the compiled binary crash in windows. And reading around, seems that I needed to downgrade the mingw version, which doesn't support C++11, and the binary runs as expected :(

So my question:...is there someone there that already is building gtkmm apps with C++11 features?

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
 Post subject: Re: gtkmm[2/3] with C++11 support (win32)
PostPosted: Fri Mar 27, 2015 8:42 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 868
Location: UK
Hallo,

I don't use Microsoft Windows and have not got around to using C++11 yet.

I am sure that there are people using gtkmm with C++11 on Microsoft Windows. Are you sure that it is a problem with the compiler? What errors do you get? Are you able to trace where the crash happens?

Microsoft Windows and Linux have different memory layouts and other features. This means that an application with errors in it could be compiled and appear to run OK on Linux, but crash on Windows.

Have you tried running static analysis tools on your code. Two Open Source ones I use are "cppcheck" and "flawfinder" these could find some bugs in your code. Also look at any warning messages you get from the compiler.

_________________
E.


Top
 Profile  
 
 Post subject: Re: gtkmm[2/3] with C++11 support (win32)
PostPosted: Fri Mar 27, 2015 11:32 pm 
Offline
Never Seen the Sunlight

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 316
Location: Fortress of solitude
Thanks for the reply, using gdb.exe on windows returns this:
Code:
0x6fc8c577 in libstdc++-6!_ZNSsC1EPKcRKSaIcE ()
   from C:\mingw\bin\libstdc++-6.dll
(gdb) where
#0  0x6fc8c577 in libstdc++-6!_ZNSsC1EPKcRKSaIcE ()
   from C:\mingw\bin\libstdc++-6.dll
#1  0x664d55ff in Glib::ustring::ustring (this=0x6c3436b4,
    src=0x6c298440 "iso_a3") at ustring.cc:316
#2  0x6c280573 in ?? () from C:\gtkmm2\bin\libgtkmm-2.4-1.dll
#3  0x6c27ce07 in ?? () from C:\gtkmm2\bin\libgtkmm-2.4-1.dll
#4  0x6c1c10ef in ?? () from C:\gtkmm2\bin\libgtkmm-2.4-1.dll
#5  0x7c90118a in ntdll!LdrInitializeThunk ()
   from C:\WINDOWS\system32\ntdll.dll
#6  0x6c1c0000 in ?? ()
#7  0x7c91d98a in ntdll!LdrFindResourceDirectory_U ()
   from C:\WINDOWS\system32\ntdll.dll
#8  0x7c921d8c in ntdll!RtlLookupElementGenericTable ()
   from C:\WINDOWS\system32\ntdll.dll
#9  0x7c921c87 in ntdll!RtlLookupElementGenericTable ()
   from C:\WINDOWS\system32\ntdll.dll
#10 0x7c90e457 in ntdll!KiUserApcDispatcher ()
   from C:\WINDOWS\system32\ntdll.dll

I don't understand this error :-/

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
 Post subject: Re: gtkmm[2/3] with C++11 support (win32)
PostPosted: Sat Mar 28, 2015 7:25 am 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 868
Location: UK
It looks like it is crashing in the constructor for the C++ string constructor front const char *. This looks like it has been called from Glib::ustring::ustring("iso_a3") and possibly as part of a conversion. Beyond that that stack trace does not really give too much more information.

_________________
E.


Top
 Profile  
 
 Post subject: Re: gtkmm[2/3] with C++11 support (win32)
PostPosted: Tue Mar 31, 2015 11:06 pm 
Offline
Never Seen the Sunlight

Joined: Sun Apr 06, 2008 6:43 pm
Posts: 316
Location: Fortress of solitude
Hi and sorry for the delay:

I ended up compiling gtkmm with gnu++11 support. This is what I did:

1.- The compiler.
2.- The gtk bundle.
3.- The following sources from ftp.gnome.org (some of them are not the updated ones but fills the version dependency from the gtk bundle):
Code:
atkmm-2.21.2.tar.bz2
cairomm-1.11.2.tar.gz
glibmm-2.28.2.tar.bz2
gtkmm-2.22.0.tar.bz2
libsigc++-2.4.1.tar.xz
pangomm-2.28.4.tar.bz2

4.- Followed the instructions here.
Now I can use c++11 with my gtkmm-2.4 projects :) the only warning is:
Quote:
warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

But you still get the binary built :)

_________________
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group