Python如何调用第三方库:使用第三方库 (sbpl)(sbpl library)

我已经在 linux\ ubuntu 上构建并安装了一个名为sbpl的库。安装后,我有以下文件:

usr/local/include/sbpl(这里有一堆文件,包括一个headers.h文件)

usr/local/libhas alibsbpl.sofile

现在我有一些麻烦编译一个简单的程序:

yus.cpp
#include <iostream>
#include <sbpl/headers.h> 
int main()
{
  EnvironmentType type;
  return 0;
}

使用这些命令编译我得到错误:

$ g++ yus.cpp -Iusr/local/include/sbpl   gives the following error 
"error: 'EnvironmentType' was not declared in this scope"
$ g++ yus.cpp -L.-lsbpl   gives the same error as above

如何正确编译和链接库?

0

enum EnvironmentType的定义从 main.cpp 移动到 headers.h,然后运行g++ yus.cpp -I/usr/local/include -L/usr/local/lib -lsbpl

本站系公益性非盈利分享网址,本文来自用户投稿,不代表边看边学立场,如若转载,请注明出处

(375)
卷饼cp:FlashBuilder卷饼替代品
上一篇
Cy3标记:ESLint:未定义“cy”(Cypress)
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(27条)