WAF-如何将外部库添加到wscript_build文件 [英] waf -how to add external library to wscript_build file

查看:190
本文介绍了WAF-如何将外部库添加到wscript_build文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图向我的waf添加一个外部库:winmm.lib库

I tried to add an external library to my waf: the winmm.lib library

现在看起来像这样:

srcs = ['timers.cpp']

LIBS ='winmm.lib';
create_lib('timers', srcs,LIBS)

它不起作用.它说我在当前库中找不到我的vmp库'winmm.lib.py'.

it doesn't work. It says I vmp library 'winmm.lib.py' was not found in the current library.

有人可以帮忙吗?

推荐答案

我从没听说过waf中的"create_lib",所以我不知道该函数的作用或作用,但是无论如何我都会尝试回答您的问题.在下面,我有一个非常基本的wscript,这是我在Linux上设置一个简单项目的典型方法.如果waf像它声称的那样独立于平台,那么这也应该适用于Windows;我还没有测试.这应该创建一个简单的共享库.

I have never heard of "create_lib" in waf, so I have no idea what that function is or does, but I'll try to answer your question anyway. Below I have a very basic wscript that is my typical way of setting up a simple project (on linux). If waf is as platform independent as it claims, then this should work for windows as well; I have not tested it. This should create a simple shared library.

def options(opt):
    opt.load('compiler_cxx')

def configure(cfg):
    cfg.load('compiler_cxx')
    cfg.check(compiler='cxx',
              lib='winmm',
              mandatory=True, 
              uselib_store='WINMM')
def build(bld)
    srcs = ['timers.cpp']
    libs = ['WINMM']
    incs = ['.']
    bld(features=['cxx','cxxshlib'],
        source=srcs,
        includes=incs,
        target='timers',,
        use=libs,
        )

将来请提供您的整个wscript和堆栈跟踪,以便更轻松地回答您的问题.

In the future please provide your whole wscript and the stack trace so its easier to answer your question.

这篇关于WAF-如何将外部库添加到wscript_build文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆