Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7605901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:17:00+00:00 2026-05-31T00:17:00+00:00

there is a nice waf vala example here: https://code.launchpad.net/~asabil/vala/vala-project-template.waf and it shows a library

  • 0

there is a nice waf vala example here:

https://code.launchpad.net/~asabil/vala/vala-project-template.waf

and it shows a library and an application in vala. Unfortunately the program in this example does not actually USE the library (which defines method “hello”). When I try to call it from the program, I get compilation errors.

I am not able to modify the wscript’s to load the library properly. What is the trick here? Thanks.

What I have added is this line in the program:

My.Lib.hello();

But it won’t compile:

Waf: Entering directory `/home/lzap/work/shellmail/TEST/vala-template/_build_'
[1/6] valac: src/hello-gtk.vala -> _build_/default/src/hello-gtk.c
../src/hello-gtk.vala:16.9-16.10: error: The name `My' does not exist in the context of `Sample.create_widgets._lambda0_'
Waf: Leaving directory `/home/lzap/work/shellmail/TEST/vala-template/_build_'
Build failed:  -> task failed (err #1): 
    {task: valac_task hello-gtk.vala -> hello-gtk.c}

I guess I need to change the program wscript:

#!/usr/bin/env python
def build(bld):
    prog = bld(features='cc cprogram')
    # symbolic name used to reference this object
    prog.name = 'hello-gtk.program'
    # name of the resulting program
    prog.target = 'hello-gtk'
    prog.source = 'hello-gtk.vala'
    # libraries to link against
    prog.uselib = 'GTK+'
    # Vala packages to use
    prog.packages = 'gtk+-2.0'
    # Extra vapi dirs
    #prog.vapi_dirs = '../my_lib'
    # Enable threading
    #prog.threading = True
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:17:00+00:00Added an answer on May 31, 2026 at 12:17 am

    The hello method is not an static method, but an instance method, so, you need to create a My.Lib instance first and then call the method.

    var obj = new My.Lib();
    obj.hello();
    

    If this still failing, try to add using My; on hello-gtk.vala.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a nice and tested piece of code out there that I can
Is there a nice way to execute code when an entity is being saved
Is there a nice way (except retemplating the whole TreeViewItem.Template ) to disable selection
How can I better write the following class? For example is there a nice
Is there a nice way to split a collection into n parts with LINQ?
Is there a nice way in the WinAPI to get a path relative to
Are there any nice libraries to render text in an image for Java? Java
Hi are there any nice videos on how to use exceptions in Delphi.
Hi are there any nice videos or other resources on how to use Interfaces
I got some binary files containing integers. Is there some nice Unix command, that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.