简体   繁体   中英

Glade can't find gui.glade

I'm using in my code:

Glade.XML gxml = new Glade.XML (null, "gui.glade", "PublicanCreators", null);

The gui.glade file is placed in the same directory as the Program.cs (which runs the code).

The compiling process has suceeded. But while running the exe i'm getting:

Stacktrace:

at <0xffffffff> at (wrapper managed-to-native) Glade.XML.gtksharp_glade_xml_get_filename (intptr) at Glade.XML.get_Filename () at (wrapper runtime-invoke) .runtime_invoke_object__this__ (object,intptr,intptr,intptr) at <0xffffffff> at Glade.XML..ctor (System.Reflection.Assembly,string,string,string) at PublicanCreators.GladeApp..ctor (string[]) [0x00018] in /home/sascha/RiderProjects/PublicanCreators/PublicanCreators/Program.cs:40 at PublicanCreators.GladeApp.Main (string[]) [0x00002] in /home/sascha/RiderProjects/PublicanCreators/PublicanCreators/Program.cs:34 at (wrapper runtime-invoke) .runtime_invoke_void_object (object,intptr,intptr,intptr)

What can i do?

Looks like you need gui.glade in the bin folder, not the source folder. Make sure it is included in your project file and is copied on compile.

It looks like the solution is to change the code to:

Glade.XML gxml = new Glade.XML ("gui.glade", "PublicanCreators", null);

There it finds the file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM