Re: [Vala] Generated vapi file for a library not compilable.



On Thu, 29 Nov 2012 10:13:40 +0800
PCMan <pcman tw gmail com> wrote:

Hello,
I got another issue with vala.
I moved the core part of my program to a separate library, and let
the main program call that library.
The library itself compiles correctly.
However, the genrated vapi file is not usable by the main program.
Both parts are written in vala.
The generated vapi file looks like this.

When compiling the main program with --pkg <my_vapi_file>, I got
errors. The generated vapi file seems to have duplicated nested
namespace for static methods like this.

I had a similar problem doing this :

namespace Panel {
        public class MenuApplet {
        }
}
    
public static AppletType register () {
        
    applet_type.id = typeof (MenuApplet); // < it's "PanelMenuApplet"
    return applet_type;
}
    
I found that the type *is not* "MenuApplet" but "PanelMenuApplet",
I just removed the namespaces for Panel Applet that fixed the problem :

public class MenuApplet {
}

    
public static AppletType register () {
        
    applet_type.id = typeof (MenuApplet);
    return applet_type;
}
    
:)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]