错误LNK2019(未解析的外部符号)在VS2008与ITK和FFTW
ERROR LNK2019 ( Unresolved external symbol) IN VS2008 WITH ITK AND FFTW
我正在执行一个使用ITK处理医学图像的项目。经过大量的工作,没有进一步的编译错误,但在链接过程中,我有以下信息:
1>------生成开始:项目:prueba_r01,配置:Debug Win32 ------1在链接……1>创建库C:Documents and SettingsGTTSMis documenttos Visual Studio 2008Projectsprueba_r01Debugprueba_r01。lib和object C:Documents and SettingsGTTSMis documenttos Visual Studio 2008Projectsprueba_r01Debugprueba_r01.exp
1祝辞prueba_r01。obj: error LNK2019: extern symbol "public: double (* __thiscall prueba_r01::multiply_matrix_2D(double ()[2],double ()[2],int,int))[2]"(?multiply_matrix_2D@prueba_r01@@QAEPAY01NPAY01N0HH@Z)未解析的函数"private: void __thiscall prueba_r01::filtro(void)"(? filtro@prueba_r01@@AAEXXZ)
1>C:Documents and SettingsGTTSMis documenttos Visual Studio 2008Projectsprueba_r01Debugprueba_r01.exe: fatal error LNK1120: 1 externos sin resolver
1>prueba_r01 - 2错误,0警告========== Generar: 0纠正,1错误,0真实化,0省掉 ==========
方法multiply_matrix_2D在私有槽" filter() "(翻译为filter)内调用时产生错误文件的头是:
#include <QtGui/QMainWindow>
#include "ui_prueba_r01.h"
#include "vicdef.h"
#include "itkImage.h"
#include "math.h"
#include <complex>
#include "fftw3.h"
using namespace std;
#define PI 3.14159265
class prueba_r01 : public QMainWindow
{
Q_OBJECT
public:
typedef double PixelType;
typedef itk::Image < PixelType, 2> ImageType;
ImageType::Pointer imagen;
double** H;
prueba_r01(QWidget *parent = 0, Qt::WFlags flags = 0);
~prueba_r01();
void matrix2D_H(int ancho, int alto, double eta, double sigma);
fftw_complex* multiply_matrix_2D(fftw_complex* out, fftw_complex* H,int a, int b);
private slots:
void openRGB();
void filtro();
private:
Ui::prueba_r01Class ui;
};
#endif // PRUEBA_R01_H
问题所在的主要部分在.cpp文件中,如下所示:
fftw_complex* res ;
res = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*a*b);
fftw_complex* H_casted= reinterpret_cast<fftw_complex*> (&H);
res = multiply_matrix_2D(out,H_casted, a, b);
将**双指针指向*fftw_complex的过程在这里完成,因为我想在频域(H(w))与图像的fft变换的结果相乘滤波器,这就是原因。注意fftw_complex是double[2],第一行是实数部分,第二行是虚数部分,这很重要吗有问题的方法如下所示:
fftw_complex* multiply_matrix_2D(fftw_complex* out, fftw_complex* H, int a ,int b){
/* The matrix out[axb] or [n0x(n1/2)+1] is the image after the FFT , and the out_H[axb] is the filter in the frequency domain,
both are multiplied POINT TO POINT, it has to be called twice, one for the imaginary part and another for the normal part
*/
fftw_complex *res;
res = (fftw_complex*) fftw_malloc(sizeof(fftw_complex)*a*b);
for (int i0 = 0; i0<a ; i0++){
for (int i1 = 0; i1<b ; i1++){
res[i1+a*i0][0] = out[i1+a*i0][0]*(H[0][0]+H[0][1]); // real part
res[i1+a*i0][1] = out[i1+a*i0][1]*(H[0][0]+H[0][1]); // imaginary part
}
}
return res;
}
任何帮助将是非常好的!!我现在完全迷路了……谢谢!谢谢!安东尼奥
将cpp文件中的函数头改为:
fftw_complex* prueba_r01::multiply_matrix_2D(fftw_complex* out, fftw_complex* H, int a, int b)
您在实现中忘记了类名(prueba_r01::),因此它没有找到函数体
- VS2008中的AVX-512指令库
- VS2008 SP1:将一对推入矢量时没有合适的默认构造函数可用
- 使输入二进制掩码适应 ITK 网格生成器
- 使用 ITK 计算图像的中值
- ITK 库依赖项错误
- 链接C 项目中的ITK标头文件
- 使用二进制掩码 C++ ITK 获取感兴趣区域
- 如何有效地处理Teamcenter ITK C++代码中的错误
- VTK / ITK/ QT - 未解决的外部符号错误 (LNK2001)
- VS2008,VS2015无法读取文件:怪异的行为
- Itk OtsumultiplethresholdsimageFilter没有处理
- C (VS2008)未生成对象文件
- ITK - 如何合并两个图像
- ITK:在执行 HelloWorld 示例时找不到 ITKCommon-x.xx.dll
- 使用 ITK 将物理点转换为索引
- 如何在Visual Studio中使用ITK配置的C 读取图像
- VS2008 C 警告LNK4229:无效指令
- FloatType图像ITK上的分割故障
- ITK中是否有表面构建函数,该函数返回一个容器管空间对象
- 错误LNK2019(未解析的外部符号)在VS2008与ITK和FFTW