DELAYLOAD在Qt LNK2001中给出链接错误:未解析的外部符号
DELAYLOAD gives linking error in Qt LNK2001: unresolved external symbol
我正在尝试在Qt创建者中使用DELAYLOAD
标志。以下是解释我的问题的最小代码:在pro
文件中:
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = DelayLoad
TEMPLATE = app
CONFIG+=qwt
SOURCES += main.cpp
mainwindow.cpp
HEADERS += mainwindow.h
win32: LIBS += -L$$PWD/../../../../../qwt-6.1.2/lib/ -lqwt
INCLUDEPATH += $$PWD/../../../../../qwt-6.1.2/include
DEPENDPATH += $$PWD/../../../../../qwt-6.1.2/include
win32: QMAKE_LFLAGS_RELEASE += /DELAYLOAD:qwt.dll
在mainwindow.cpp
:中
#include "mainwindow.h"
#include <QPushButton>
#include "qwt_plot.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QPushButton *button = new QPushButton("replace by plot");
connect(button, SIGNAL(clicked(bool)),this,SLOT(buttonClicked()));
this->setCentralWidget(button);
}
MainWindow::~MainWindow()
{
}
void MainWindow::buttonClicked()
{
QwtPlot *plot = new QwtPlot();
this->setCentralWidget(plot);
}
这会产生以下错误:
qwt.lib(qwt.dll):-1:错误:LNK2001:未解析的外部符号__delayLoadHelper2
我点击了几个Run qmake
、Clear
、Rebuild
。这并不能解决最初的问题。我将"Qt 5.4.2"与MSVC 2013 64 bit
编译器一起使用
在.pro文件中添加以下行,没错。
win32:LIBS += "-LC:Program Files (x86)Microsoft Visual Studio 12.0VClibamd64" -ldelayimp
相关文章:
- C++:Application.cpp中抛出了未解析的外部符号(解决方案在问题的末尾,供未来的读者参考)
- 未解析的外部符号_MsiLocateComponentW@12.
- 在C++中使用 gRPC 时未解析的外部符号
- LibPrivoxy: 未解析的外部符号 __declspec(dllimport) int __stdcall Sta
- 尝试从 XamlApplication 编译 C++/WinRT 空白应用程序时,我收到未解析的外部符号 winrt_make_*
- 我收到错误LNK2001:未解析的外部符号(C++代码)
- 可视抽象类 c++(错误 LNK 2001:未解析的外部符号)
- 如何摆脱C++中未解析的外部符号"private: static char"错误?
- 当 lib 已添加到其他依赖项时,如何在 VS 中调试未解析的外部符号错误
- 仅在少数方法(静态或共享库)中解析的外部符号
- 未解析的外部符号"__declspec(dllimport)与 Spdlog c++ 库
- 函数 _main (OPENGL C++) 中引用的未解析的外部符号 ________
- 错误LNK2019未解析的外部符号"public: __thiscall SLinkList<char>::SLinkList<char>(void)"
- 使用静态 constexpr 成员的未解析外部符号
- 引入参数化构造函数后显示 LNK 2019 未解析外部符号的代码错误
- Dlib LNK2001未解析的外部符号USER_ERROR__consistent_build_configurati
- 矛盾的未解决的外部符号+未使用的库与VS2017和FFMPEG 4
- 链接器错误:切换到unicode生成给出:未解析的外部符号WinMain
- 错误 LNK2019:未解析的外部符号"外部"C"此错误是什么?
- 错误 : LNK2019: 未解析的外部符号"外部 "C"