私は画像のブレ除去のためのプログラムをコンパイルしようとしています。 は、私は、ファイルapply_blur_kernel_mex.cは、次のコードを持っているmexでCファイルをコンパイルするときにMatlabエラーが発生する
mex apply_blur_kernel_mex.c
を実行しよう
#include <mex.h>
#include <stdlib.h>
#include <math.h>
#include <matrix.h>
#include "ow_homography.h"
...
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
...
compute_homography_matrix(Ksharp, &theta_list[k*3], invKblurry, H);
...
}
問題が
#ifndef OW_HOMOGRAPHY_H
#define OW_HOMOGRAPHY_H
#include "ow_mat3.h"
INLINE void compute_homography_matrix(const double *Ksharp, const double *theta, const double *invKblurry, double *H) {
double R[9];
/* Compute homography */
cp3(invKblurry,H);
rot3(theta[0],theta[1],theta[2],R);
mmip3(R,H);
mmip3(Ksharp,H);
}
ow_homography.h別のファイルにある関数compute_homography_matrixであります
この最後の操作(cp3、rot3 ...)は、プログラムのすべての操作を含む別のファイルow_mat3.hにあります。
Error using mex
Undefined symbols for architecture x86_64:
"_compute_homography_matrix", referenced from:
mexFunction in apply_blur_kernel_mex.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
任意の提案は、この問題を解決するために: はので、私は次のような問題を持っている
mex apply_blur_kernel_mex.c
を呼び出すしようとすると? ありがとうございます。
エラーメッセージに記述されている関数の先頭にアンダースコアがありますが、例のコードは – chiliNUT
ではありません。gccにはシンボルにアンダースコアを付けるための素敵な '-fleading-underscore'があります。ダンノについては、clang。 –