使用WAF和NS3时链接共享库

发布于 2025-01-05 04:40:52 字数 424 浏览 4 评论 0原文

这是与名为 NS3 的网络模拟器相关的查询。

假设我想构建一个名为“MyProgram”的程序,并在构建它时链接一个共享库。 如何使用 WAF 执行此操作?我已将“MyProgram”放入名为“examples/thesis”的目录中并创建了一个 wscript。我还将“MyProgram”所需的文件放入暂存目录中。 [有关在 NS3 中构建文件时使用 WAF 的更多信息:链接< /a> ]

这是我在没有库的情况下构建“MyProgram”时运行的命令: ./waf --build MyProgram

在构建“MyProgram”时如何将库链接到共享库?

提前致谢!

This is a query related to the network simulator called NS3.

Say that I want to build a program called 'MyProgram' and to link a shared library when building it.
How do I do this with WAF? I have put 'MyProgram' in a directory called 'examples/thesis' and created a wscript. I am also putting the files needed for 'MyProgram' in the scratch-directory. [Some more info about the usage of WAF when building files in NS3: Link ]

This is the command that I would run to build 'MyProgram' without the library: ./waf --build MyProgram

How do I link the library the shared library when building 'MyProgram'?

Thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

<逆流佳人身旁 2025-01-12 04:40:52

您可以使用 lib 命名参数将库列表传递到程序中。

def build(ctx):
    ctx(rule='cp ${SRC} ${TGT}', source='src/main.c', target='main.c')
    ctx.program(source='main.c', target='app', lib=['mysqlclient'])

You can use the lib named argument to pass a list of libraries into program.

def build(ctx):
    ctx(rule='cp ${SRC} ${TGT}', source='src/main.c', target='main.c')
    ctx.program(source='main.c', target='app', lib=['mysqlclient'])
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文