I am getting this error.

LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl fastICA(double * *,int,int,int,double * *,double * *,double * *,double * *)" (?fastICA@@YAXPAPANHHH0000@Z)
Debug/vctest.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

I have put the included file but still I get this.I am using VC6 and in Windows

Recommended Answers

All 3 Replies

Somewhere there is a library containing the compiled code that is the actual function fastICA. You're not linking to it. You should be. You need to tell your IDE (which I'm guessing is some Visual Studio version) where the library is, and that you want to link to that library.

The header file that you #include does not contain the function. It contains just enough information so that your compiler knows the function exists and what parameters it takes and what parameter it returns. The actual function is in the library, that you're not linking to.

You should read this: https://www.daniweb.com/software-development/cpp/tutorials/466177/understanding-c-from-source-to-binaries

It's for C++ rather than C, but the actual mechanics of what a source file is and what a headr is and what compiling does and what linking does are the same. When you have read it you will understand what "unresolved symbol" means and you'll have a much, much better understanding of what you're doing.

I put all the function definitions in the same file with its prototypes but I get this error.

LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl vect_delete(double *)" (?vect_delete@@YAXPAN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_delete(double * *,int,int)" (?mat_delete@@YAXPAPANHH@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_inverse(double * *,int,double * *)" (?mat_inverse@@YAXPAPANH0@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_decenter(double * *,int,int,double *)" (?mat_decenter@@YAXPAPANHHPAN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_diag(double *,int,double * *)" (?mat_diag@@YAXPANHPAPAN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl vect_apply_fx(double *,int,double (__cdecl*)(double,double),double)" (?vect_apply_fx@@YAXPANHP6ANNN@ZN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_mult(double * *,int,int,double * *,int,int,double * *)" (?mat_mult@@YAXPAPANHH0HH0@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_apply_fx(double * *,int,int,double (__cdecl*)(double,double),double)" (?mat_apply_fx@@YAXPAPANHHP6ANNN@ZN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_transpose(double * *,int,int,double * *)" (?mat_transpose@@YAXPAPANHH0@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_center(double * *,int,int,double *)" (?mat_center@@YAXPAPANHHPAN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "double * __cdecl vect_create(int)" (?vect_create@@YAPANH@Z)
serialtest.obj : error LNK2001: unresolved external symbol "double * * __cdecl mat_create(int,int)" (?mat_create@@YAPAPANHH@Z)
serialtest.obj : error LNK2001: unresolved external symbol "double __cdecl mat_max_diag(double * *,int,int)" (?mat_max_diag@@YANPAPANHH@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_sub(double * *,double * *,int,int,double * *)" (?mat_sub@@YAXPAPAN0HH0@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_mean_rows(double * *,int,int,double *)" (?mat_mean_rows@@YAXPAPANHHPAN@Z)
serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl mat_copy(double * *,int,int,double * *)" (?mat_copy@@YAXPAPANHH0@Z)
Debug/vctest.exe : fatal error LNK1120: 16 unresolved externals
Error executing link.exe.

vctest.exe - 17 error(s), 5 warning(s)

but if I create a new project and compile it ,it compiles fine .I want to integrate with an existing project of mine, that is where I am getting the problem.

Same problem. Unresolved external symbol means you haven't linked against the library containing that function (or, if no such library exists, you haven't written that function).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.