我的做法:(1)右键工程-添加了头文件,在MainWindow.cpp中#include 了头文件
(2)pro中,最后添加了 LIBS +=-LD:/study/QT_Test/Test/DLLTest/Dll/-l库名(没有后缀)
(3)//Enhance 是我库中文件
//__declspec(dllexport) bool Enhance(unsigned char *pInput, unsigned char *pOutput, int nWidth, int nHeight, float fMin = 0.01f, float fMax = 0.01f);
我的调用:
void MainWindow::on_pushButton_clicked()
{
unsigned char *p=(unsigned char *)malloc(sizeof (unsigned char));
unsigned char *q=(unsigned char *)malloc(sizeof (unsigned char));
qDebug()<<Enhance(p,q,350,200,0.01f,0.01f);
}
出现的问题:(1)mainwindow.obj:-1: error: LNK2019: ���������ⲿ���� "bool __cdecl Enhance(unsigned char *,unsigned char *,int,int,float,float)" (?Enhance@@YA_NPEAE0HHMM@Z)���÷����ں��� "private: void __cdecl MainWindow::on_pushButton_clicked(void)" (?on_pushButton_clicked@MainWindow@@AEAAXXZ) �б�����
(2)debug\Dll.exe:-1: error: LNK1120: 1 �����������ⲿ����
请问各位大神这些问题的原因是什么?怎样改正