将 libtensorflow_cc.so 文件链接到 QT 项目 [英] Linking libtensorflow_cc.so file to QT project

查看:39
本文介绍了将 libtensorflow_cc.so 文件链接到 QT 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 QT 创建器中使用 tensorflow_cc 库我尝试在 .pro 文件中链接 libtensorflow_cc.so,但我仍然无法访问头文件.

I want to use tensorflow_cc library in QT creater I tried linking the libtensorflow_cc.so in .pro file but I'm still unable to access the header files.

test.pro 文件:

test.pro file:

LIBS += -L/usr/local/lib/ -ltensorflow_cc
INCLUDEPATH += /usr/local/lib/

test.cpp 文件:

test.cpp file:

#include <tensorflow/core/platform/env.h>

错误:

tensorflow/core/platform/env.h: No such file or Directory

我已将 .so 文件的路径添加到 LD_LIBRARY_PATH.无论如何要包含 tensorflow 库并在 QT 中使用头文件.这是一个类似的问题 但对我帮助不大.谢谢!

I have added the path of the .so file to LD_LIBRARY_PATH. Is there anyway to include the tensorflow library and use the header files in QT. This is a similar question but it didn't quite help me. Thanks!

推荐答案

将此添加到 .pro 文件:

LIBS += /usr/lib/libtensorflow_cc.so

这篇关于将 libtensorflow_cc.so 文件链接到 QT 项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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