forum.alglib.net http://forum.alglib.net/ |
|
unresolved external symbol error http://forum.alglib.net/viewtopic.php?f=2&t=338 |
Page 1 of 1 |
Author: | michaelMe [ Fri Apr 08, 2011 12:31 pm ] |
Post subject: | unresolved external symbol error |
Hello, Thanks for creating ALGLIB! I'm getting the following error: 1>main.obj : error LNK2019: unresolved external symbol "void __cdecl alglib::polynomialbar2pow(class alglib::barycentricinterpolant const &,class alglib::real_1d_array &)" (?polynomialbar2pow@alglib@@YAXABVbarycentricinterpolant@1@AAVreal_1d_array@1@@Z) referenced in function _main When I compile the following code in MS Visual C++ 2008 Express: Code: #include <stdlib.h> #include <stdio.h> #include <math.h> #include "interpolation.h" using namespace alglib; int main(int argc, char **argv) { real_1d_array x = "[-4.71, -3.77, -2.83, -1.89, -0.25]"; real_1d_array y = "[0, 1, 2, 3, 4]"; ae_int_t m = 3; double t = 0; ae_int_t info; barycentricinterpolant p; polynomialfitreport rep; double v; polynomialfit(x, y, m, info, p, rep); v = barycentriccalc(p, t); printf("%.2f\n", double(v)); real_1d_array a_eqdist; polynomialbar2pow(p, a_eqdist); printf("%s\n", a_eqdist.tostring(4).c_str()); return 0; } Please advise because I'm not sure what I'm doing wrong. Thanks and regards, Michael |
Author: | Sergey.Bochkanov [ Fri Apr 08, 2011 1:24 pm ] |
Post subject: | Re: unresolved external symbol error |
I think that you've forgot to add one of the ALGLIB files to your project. You have to add all .cpp files from ALGLIB's /cpp/src folder. |
Author: | michaelMe [ Fri Apr 08, 2011 1:47 pm ] |
Post subject: | Re: unresolved external symbol error |
Thanks for the response! I copied and pasted all 27 files from the /cpp/src folder to the project, but I'm getting the same error message. I'll play around with this more - there must be something I'm doing wrong. A good weekend to you! |
Author: | michaelMe [ Fri Apr 08, 2011 1:51 pm ] |
Post subject: | Re: unresolved external symbol error |
Er um *sheepish grin* I think I found the problem. I was using an older version of ALGLIB in the test program and then added the latest version to test the "polynomialbar2pow" function. The error message disappeared after I'd rebuilt the solution. Sorry about that! |
Author: | Sergey.Bochkanov [ Fri Apr 08, 2011 1:52 pm ] |
Post subject: | Re: unresolved external symbol error |
BTW, it is better to add .cpp files to your project as is, not to copy/paste them. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |