After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 543772 - Unable to load from glade using gtkmm in MS Visual Studio 2008
Unable to load from glade using gtkmm in MS Visual Studio 2008
Status: RESOLVED OBSOLETE
Product: gtkmm
Classification: Bindings
Component: general
2.4.x
Other All
: Normal major
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2008-07-19 20:35 UTC by Emmanuel
Modified: 2014-01-29 08:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Emmanuel 2008-07-19 20:35:15 UTC
Please describe the problem:
Hi,
My simple gtkmm application fails to run in MS Visual Studio 2008 although it
successfully compiles in the IDE (Have added the property sheets and tweaked
the settings as described on the gtkmm documentation home page.

Reason:
The execution of the program fails when it encounters the following code
snippet:
Glib::RefPtr<Gnome::Glade::Xml> mainXml= Gnome::Glade::Xml::create(cars.glade);

it produces the following error message:

Glib::ConvertError at memory location 0x0023f52c

console shows a warning:
(Project CARS.exe:5000): libglade-WARNING **: could not find glade file
'\xcc\xc
c\xcc\xcccars.glade'


Steps to reproduce:
1. Create any simple glade file
2. Create a gtkmm project and write a small program to load widgets from the glade file
3. Compile and run the program in Microsoft Visual Studio


Actual results:
Application crashes on execution

Expected results:
the application should have executed well because it was successfully compiled
without errors

Does this happen every time?
Yes

Other information:
Comment 1 Murray Cumming 2008-08-04 11:19:53 UTC
Do you have this problem with the examples in the libglademm tarball?
Comment 2 Emmanuel 2008-08-05 12:19:10 UTC
(In reply to comment #1)
> Do you have this problem with the examples in the libglademm tarball?
> 
please could you tell me where the examples are located?
Comment 3 Murray Cumming 2008-08-05 12:22:14 UTC
In the examples directory in the source tarball:
http://ftp.gnome.org/pub/GNOME/sources/libglademm/2.6/
Comment 4 Emmanuel 2008-08-05 12:26:55 UTC
(In reply to comment #1)
> Do you have this problem with the examples in the libglademm tarball?
> 
By the way I tested the execution to run under MingW compiler in CodeBlocks and it runs without errors but fails under Visual Studio. I think the problem lies with the Visual C++'s comparability with libglademm libraries, otherwise why does it execute error-free under GNU-based compilers but not under Visual C++?
Comment 5 Murray Cumming 2008-08-05 12:55:39 UTC
You can't mix compilers. Libraries are built for one specific compiler only, particularly in the case of C++ compilers. Where did you get this DLL from? 
Comment 6 Emmanuel 2008-08-05 13:22:21 UTC
I got the GTKmm install package from the official GTKmm webpage. It includes a folder MSVC containing property sheets for Visual Studio 2005. 

On the official Gtkmm documentation page, there are instructions on configuring VS 2005 to compile and run Gtkmm apps on VS as well as on Dev-Cpp. I followed the instructions to the letter and was capable of compiling and running the Gtkmm-built C++ source codes under both compilers. 

However if I attempted to load glade files from within VS Studio, I got the errors as described in my initial bug report, whereas under Dev-Cpp or CodeBlocks, I faced no problem.

Unless there are different versions of libglademm for the two compilers, which I am not aware of, I still find a reason to be confused why I cannot run a program that uses glade files in Visual Studio but runs glitch-free under Dev-Cpp or Code-Blocks. More confusing is that if glade files are not used, the program compiles and runs under both IDEs.

Since VS produced the root this code snippet line:

Glib::RefPtr<Gnome::Glade::Xml> mainXml= Gnome::Glade::Xml::create(cars.glade);

I believe the resolution of the path to the glade resource file(cars.glade) by VS could be the source of the problem as it reports the path not found as "\xcc\xcc\xcc\xcccars.glade"

Perhaps there is no actual conversion of the path from ASCII to the Unicode by VS when resolving the path and hence it compiles but fails to run because the path string is invalid. 

Thanks
Comment 7 Murray Cumming 2008-08-05 13:29:25 UTC
> Unless there are different versions of libglademm for the two compilers, which
> I am not aware of,

I think there must be. g++ and MSVC++ are definitely not ABI compatible.

I also guess that there must be multiple versions of each MSVC++ DLL for MT and non-MT, and for the two different MSVC++ memory models.

> I still find a reason to be confused why I cannot run a program that uses 
> glade files in Visual Studio but runs glitch-free under
> Dev-Cpp or Code-Blocks.

Presumably Dev-Cpp and Code-Blocks are using g++.

> More confusing is that if glade files are not used, the program compiles and runs under both IDEs.

This might be just luck, though it does seem strange.

Unfortunately, the win32 stuff does not seem well supported right now. Cedric Gustin is trying to hand over maintainership of that to some other people, properly documenting what the win32 install package should provide, among other things.

Sorry, I'm not using Windows on a daily basis myself.
Comment 8 Murray Cumming 2009-01-27 09:15:32 UTC
CCing Armin so we can resolve this issue and eventually close this bug report.
Comment 9 Armin Burgmeier 2009-01-27 20:45:03 UTC
I have tried loading glade files with both MSVC++ and MinGW when I created the Windows binaries, and it worked for both.

Emmanuel, is this problem still present with the binaries from a recent (gtkmm 2.14) Windows installer?
Comment 10 Murray Cumming 2009-02-05 17:27:29 UTC
Emmanuel, please respond.
Comment 11 Emmanuel 2009-02-05 21:06:36 UTC
Sorry for the late reply...

I have not yet tried the latest installer binaries (gtkmm 2.14). I had the problem with the gtkmm 2.10.11 installer binaries. For the time being I have been using the MingW compiler.

I guess changes have been made and the problem has been solved. Anyway, I will check the binaries and inform you if I still faced the problems.

Thanks,
Comment 12 Murray Cumming 2009-02-21 13:38:43 UTC
Please do check.
Comment 13 Kjell Ahlstedt 2013-12-17 15:53:18 UTC
Since at least 4 years, libglademm is deprecated in favor of Gtk::Builder.
Are there any problems reading glade files with Gtk::Builder?
Unless there are, this bug is obsolete.