预期的构造函数,析构函数或类型转换,在带有__declspec(dllexport)的(()令牌之前

时间:2019-07-03 14:35:43

标签: c++

我已经看过几篇关于同一错误的文章,而且似乎在编译器找不到与签名匹配的构造函数时会发生这种情况?

但是我不能排除这种可能性,因为我的情况非常不同-它有一个__declspec(dllexport),而且我不确定这是否是导致问题的元凶。

这是错误消息:

yuqiong@yuqiong-G7-7588:/media/yuqiong/DATA/Vignetting_corrector/C++/Vig_Correction/build$ make
Scanning dependencies of target correction
[ 50%] Building CXX object CMakeFiles/correction.dir/Vig_Correction.cpp.o
In file included from /media/yuqiong/DATA/Vignetting_corrector/C++/Vig_Correction/Vig_Correction.cpp:5:0:
/media/yuqiong/DATA/Vignetting_corrector/C++/Vig_Correction/ColorCorrection.hpp:16:10: error: expected constructor, destructor, or type conversion before ‘(’ token
 _declspec(dllexport) int VignettingCorrectionUsingRG(unsigned char* pImage, int ht, int wd,
          ^
/media/yuqiong/DATA/Vignetting_corrector/C++/Vig_Correction/Vig_Correction.cpp: In function ‘int VignettingCorrect(IplImage*)’:
/media/yuqiong/DATA/Vignetting_corrector/C++/Vig_Correction/Vig_Correction.cpp:47:65: error: ‘VignettingCorrectionUsingRG’ was not declared in this scope
  int flag=VignettingCorrectionUsingRG(pImageBuffer, sht, swd, vp);
                                                                 ^
CMakeFiles/correction.dir/build.make:62: recipe for target 'CMakeFiles/correction.dir/Vig_Correction.cpp.o' failed
make[2]: *** [CMakeFiles/correction.dir/Vig_Correction.cpp.o] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/correction.dir/all' failed
make[1]: *** [CMakeFiles/correction.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

这是我的ColorCorrection.hpp文件...

#ifndef COLOR_CORRECTION_HPP
#define COLOR_CORRECTION_HPP

#include <vector>
using namespace std;

__declspec(dllexport) int VignettingCorrectionUsingRG(unsigned char* pImage, int ht, int wd, vector<double>& vp);

#endif

非常感谢您的提前帮助...

0 个答案:

没有答案