I get the following link errors when I try to build my program in Visual C++ Express 2008 Express Edition on windows 32.
1>Linking...
1>RBF_matrixFill.obj : error LNK2019: unresolved external symbol "void __cdecl mallocCu(int,int * *,int *)" (?mallocCu@@YAXHPAPAHPAH@Z) referenced in function "void __cdecl RBF_matrixFill(void)" (?RBF_matrixFill@@YAXXZ)
1>RBF_matrixFill.obj : error LNK2019: unresolved external symbol "void __cdecl mallocCu(int,struct float3 * *,struct float3 *)" (?mallocCu@@YAXHPAPAUfloat3@@PAU1@@Z) referenced in function "void __cdecl RBF_matrixFill(void)" (?RBF_matrixFill@@YAXXZ)
1>RBF_matrixFill.obj : error LNK2019: unresolved external symbol "void __cdecl mallocCu(int,float * *,float *)" (?mallocCu@@YAXHPAPAMPAM@Z) referenced in function "void __cdecl RBF_matrixFill(void)" (?RBF_matrixFill@@YAXXZ)
1>RBF_matrixFill.obj : error LNK2019: unresolved external symbol "void __cdecl sgesv(int *,int *,float *,int *,int *,float *,int *,int *)" (?sgesv@@YAXPAH0PAM00100@Z) referenced in function "void __cdecl RBF_matrixFill(void)" (?RBF_matrixFill@@YAXXZ)
1>RBF_matrixFill.obj : error LNK2019: unresolved external symbol "void __cdecl outputData(float *,int,int,char *)" (?outputData@@YAXPAMHHPAD@Z) referenced in function "void __cdecl RBF_matrixFill(void)" (?RBF_matrixFill@@YAXXZ)
1>../bin/matrixFill.exe : fatal error LNK1120: 5 unresolved externals
I have added the code where I am getting the errors from below:
#include "mkl.h"
//utility includes (in common folder)
#include "fileIO.h"
#include "mallocCu.h"
extern void sgesv (int*, int*, float*, int*,int*,float*, int*, int*);
sgesv (&numnode, &nrhs, matforcpu, &numnode, ipvt, rhs, &numnode, &info);
if(print_mat){
outputData( matforcpu, numnode, numnode, mat_cpu_output );
}
mallocCu( numnode*numnode, &matfordev);
mallocCu( numnode, &cdev, c);
mallocCu( numnode, &nodedev, node);
mallocCu( numnode, &ncodedev, ncode);
To solve the problem, I put the include files in extern "C" but then I get an error when I do that too.
Any help will be appreciated. Thanks.
It means that compiler ( linker ) can't find source codes for that functions