作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在编写一个应用程序来测试 pbs_connect() 是否正常工作。这是我的代码:
#include <stdio.h>
#include "/usr/include/torque/pbs_ifl.h"
#include "/usr/include/torque/pbs_error.h"
#include <pbs_config.h>
#include "libpbs.h"
int main() {
printf("Hello world\n");
int server = pbs_connect("inferno.local");
//batch_status * stat1 = pbs_statserver(server, NULL, NULL);
pbs_errno = 0;
batch_status * stat1 = PBSD_status(server, 21, (char *)"", NULL, NULL);
printf("fd: %d\n", server);
//printf("text: %s\n", stat1->text);
//printf("name: %s\n", stat1->name);
printf("name: %d\n", pbs_errno);
return 0;
}
//compiled using - //g++ -o test test.c -L/usr/lib64 -ltorque
我得到:
# g++ -o test test.c -L/usr/lib64 -ltorque
test.c:7:24: error: pbs_config.h: No such file or directory
test.c:8:20: error: libpbs.h: No such file or directory
test.c: In function 'int main()':
test.c:19: warning: deprecated conversion from string constant to 'char*'
test.c:24: error: 'PBSD_status' was not declared in this scope
包含 PBSD_status 的源文件可以在这里找到: https://github.com/adaptivecomputing/torque/blob/4.2.7/src/lib/Libifl/PBSD_status.c
是否需要在我的 g++ 命令中包含一些内容才能使其正常工作?我检查了/usr/lib64/,没有libpbs.h或pbs_config.h。如果他们不在那里,他们会在哪里?
最佳答案
就您的 header 而言,您遇到了已安装 header 和未安装 header 之间的区别。本质上,软件项目不会安装该项目中的每个 header ,只会安装与 API 相关的 header 。其他两个不在 API 中,因此未安装。您需要引用它们的路径。
就在库中包含 PBSD_status() 而言,您可以编辑 Libpbs 的 Makefile 以包含 PBSD_status() 的源文件,然后重建,或者您可以链接到 libifl 库,它位于 src/lib/项目基目录中的 Libifl。
关于c++ - libtorque - 我如何包含 PBSD_status 函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31525847/
我正在编写一个应用程序来测试 pbs_connect() 是否正常工作。这是我的代码: #include #include "/usr/include/torque/pbs_ifl.h" #incl
我是一名优秀的程序员,十分优秀!