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

  • Home
  • SEARCH
  • 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 7771805
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:44:22+00:00 2026-06-01T16:44:22+00:00

The waf command waf build shows compiler errors (if there are any) while waf

  • 0

The waf command waf build shows compiler errors (if there are any) while waf debug or waf release does not and always fails, utilizing the following wscript file (or maybe the wscript file has some other shortcomings I am currently not aware of):

APPNAME = 'waftest'
VERSION = '0.0.1'
def configure(ctx):
    ctx.load('compiler_c')
    ctx.define('VERSION', VERSION)
    ctx.define('GETTEXT_PACKAGE', APPNAME)

    ctx.check_cfg(atleast_pkgconfig_version='0.1.1')
    ctx.check_cfg(package='glib-2.0', uselib_store='GLIB', args=['--cflags', '--libs'], mandatory=True)
    ctx.check_cfg(package='gobject-2.0', uselib_store='GOBJECT', args=['--cflags', '--libs'], mandatory=True)
    ctx.check_cfg(package='gtk+-3.0', uselib_store='GTK3', args=['--cflags', '--libs'], mandatory=True)
    ctx.check_cfg(package='libxml-2.0', uselib_store='XML', args=['--cflags', '--libs'], mandatory=True)

    ctx.check_large_file(mandatory=False)
    ctx.check_endianness(mandatory=False)
    ctx.check_inline(mandatory=False)

    ctx.setenv('debug')
    ctx.env.CFLAGS = ['-g', '-Wall']
    ctx.define('DEBUG',1)

    ctx.setenv('release')
    ctx.env.CFLAGS = ['-O2', '-Wall']
    ctx.define('RELEASE',1)




def pre(ctx):
    print ('Building [[[' + ctx.variant + ']]] ...')


def post(ctx):
    print ('Building is complete.')

def build(ctx):
    ctx.add_pre_fun(pre)
    ctx.add_post_fun(post)

#   if not ctx.variant:
#       ctx.fatal('Do "waf debug" or "waf release"')

    exe = ctx.program(
        features = ['c', 'cprogram'],
        target = APPNAME+'.bin',
        source = ctx.path.ant_glob(['src/*.c']),
        includes = ['src/'],
        export_includes = ['src/'],
        uselib = 'GOBJECT GLIB GTK3 XML'
    )
#   for item in exe.includes:
#       print(item)



from waflib.Build import BuildContext

class release(BuildContext):
    cmd = 'release'
    variant = 'release' 

class debug(BuildContext):
    cmd = 'debug'
    variant = 'debug'

Error resulting from waf debug :

Build failed
 -> task in 'waftest.bin' failed (exit status -1): 
    {task 46697488: c qqq.c -> qqq.c.1.o}
[useless filepaths]

I had a look at the waf demos, read the wafbook at section 6.2.2 but those did not supply me with valuable information in order to fix this issue.

What’s wrong, and how do I fix it?

  • 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-06-01T16:44:23+00:00Added an answer on June 1, 2026 at 4:44 pm

    You need to do at least the following:

    def configure(ctx):
      ...
      ctx.setenv('debug')
      ctx.load('compiler_c')
      ...
    

    Since the cfg.setenv function resets whole previous environment. If you want to save previous environment, you can do cfg.setenv('debug', env=cfg.env.derive()).

    Also, you don’t need to explicitly specify the features = ['c', 'cprogram'], since, it’s redundant, when you call bld.program(...).

    P.S. Don’t forget to reconfigure after modifying wscript file.

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

Sidebar

Related Questions

there is a nice waf vala example here: https://code.launchpad.net/~asabil/vala/vala-project-template.waf and it shows a library
Running node-waf with --verbose shows it uses g++ with -g . It seems to
There are some build systems that are able to generate platform specific project files
I use waf (http://code.google.com/p/waf/) to build a fortran library (which also uses some c-code).
I want to build a shared library using waf as it looks much easier
after I run node-waf configure and node-waf build , a .lock-wscript show in my
Can the Waf build system generate Visual Studio project files for C/C++?
I have begun using the waf build system as an alternative to CMake. So
Has anyone installed pycairo 1.10 on the mac using the new waf build? Its
I cloned the node git repo but the waf build tool that comes with

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.