问题描述
我花了两三天时间阅读并尝试不同的建议,但仍然找不到解决我问题的方法。
这是我的project.pro的摘录
win32:CONfig(release,debug|release): LIBS += -L$$PWD/../../../RecFusionSDK/lib/ -lRecFusion
INCLUDEPATH += $$PWD/../../../RecFusionSDK/include
DEPENdpath += $$PWD/../../../RecFusionSDK/include
我可以在 QtCreator 上正常打开项目并在我的代码上使用库中的函数。但是当我尝试 make
项目时,它失败并显示以下错误:
release/mainwindow.o:mainwindow.cpp:(.text+0x2a1): undefined reference to `RecFusion::RecFusionSDK::setLicenseFile(char const*)'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [Makefile.Release:72: release/recfusion.exe] Error 1
Makefile 的第 72 行是链接器命令,如下:
g++ -Wl,-s -Wl,-subsystem,console -mthreads -o release/recfusion.exe release/main.o release/mainwindow.o release/moc_mainwindow.o -LC:/RecFusionSDK/lib -lRecFusion C:/Qt/5.14.2/mingw73_64/lib/libQt5Widgets.a C:/Qt/5.14.2/mingw73_64/lib/libQt5Gui.a C:/Qt/5.14.2/mingw73_64/lib/libQt5Core.a
我正在使用 Qt 安装附带的 mingw73_64
。
任何帮助将不胜感激。就像我说的那样,我已经尝试了所有方法,但总是出现相同的错误。在我看来,由于某种原因,链接器没有找到相应的 RecFusion.dll
有什么想法可以解决这个问题吗?提前致谢。
代码非常简单:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <RecFusion.h>
#include <iostream>
using namespace RecFusion;
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),ui(new Ui::MainWindow)
{
ui->setupUi(this);
bool ok = RecFusionSDK::setLicenseFile("License.dat");
if (!ok) {
std::cout << "Invalid RecFusion license. Export will be disabled." << std::endl;
}
}
MainWindow::~MainWindow()
{
delete ui;
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)