Include Anaconda python 3.6 in Qt C++ application without Anaconda#39;s Qt version(在没有 Anaconda 的 Qt 版本的 Qt C++ 应用程序中包含 Anaconda python 3.6)
问题描述
我想在我的 Qt C++ 应用程序中包含 Anaconda 的 Python 3.6.原因是我希望能够在我的 C++ 应用程序中包含一个神经网络,它是用 Python 编写的.
我尝试通过以下方式包含 Python,我发现
有没有办法从 Anaconda 中包含 Python,但告诉 Qt Creator 使用我的自定义 Qt 版本?
不知何故,我在使用不同的应用程序时再次遇到了同样的问题,因此发布了一个新问题,因为我认为这是一个不同的问题.
我同时找到了解决方案并发布了答案 这里.
I want to include Anaconda's Python 3.6 in my Qt C++ application. The reason why is that I want to be able to include a neural network in my C++ application, which is written in Python.
I tried to include Python in the following way, which I found online:
INCLUDEPATH += /home/[username]/anaconda3/include/python3.6m
LIBS += -L/home/[username]/anaconda3/lib/ -lpython3.6m
It finds the Python.h header but linking to the Python libraries causes Qt Creator to (apparently) use the Qt libraries of Anaconda and not the ones I downloaded and installed in my home folder.
This is problematic for two reasons:
My program needs Qt 5.9.1 and does not compile with Qt 5.6 (Anaconda's version)
Even if it compiled with Qt 5.6 there are suddenly errors of missing libraries, see below:
Is there any way to include Python from Anaconda but tell Qt Creator to use my custom Qt Version?
Unkonwingly, I had the same problem again with a different application and thus posted a new question because I thought it was a different issue.
I found a solution in the mean time and posted the answer here.
这篇关于在没有 Anaconda 的 Qt 版本的 Qt C++ 应用程序中包含 Anaconda python 3.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在没有 Anaconda 的 Qt 版本的 Qt C++ 应用程序中包含 Anaconda python 3.6
基础教程推荐
- CString 到 char* 2021-01-01
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 初始化列表*参数*评估顺序 2021-01-01
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
