本人C++小白,初学C++,QT,想向各位大神请教下QT调用C++的dll 问题 5C

我的做法:(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 ���޷��������ⲿ����
请问各位大神这些问题的原因是什么?怎样改正

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问