forum.alglib.net
http://forum.alglib.net/

Problem compiling empty project - PCA
http://forum.alglib.net/viewtopic.php?f=2&t=75
Page 1 of 1

Author:  swagger [ Wed Oct 13, 2010 1:12 pm ]
Post subject:  Problem compiling empty project - PCA

Hi guys.
I've got a problem compiling an empty project of PCA in MSVS 2008.
I've created a project and added all the header files you can see below and the relatives .cpp files.

Code:
// PCA.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "alglibinternal.h"
#include "alglibmisc.h"
#include "ap.h"
#include "dataanalysis.h"
#include "linalg.h"
#include "optimization.h"
#include "solvers.h"
#include "specialfunctions.h"
#include "statistics.h"
#include <cstdio>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>

using namespace std;
using namespace alglib;
using namespace alglib_impl;

int _tmain(int argc, _TCHAR* argv[])
{
   

   system("PAUSE");
   return 0;
}



Building this empty project to test if it runs, I've got an error message saying:

1>dataanalysis.obj : error LNK2019: unresolved external symbol "void __cdecl alglib_impl::calculatemoments(struct alglib_impl::ae_vector *,int,double *,double *,double *,double *,struct alglib_impl::ae_state *)" (?calculatemoments@alglib_impl@@YAXPAUae_vector@1@HPAN111PAUae_state@1@@Z) referenced in function "void __cdecl alglib_impl::dsnormalize(struct alglib_impl::ae_matrix *,int,int,int *,struct alglib_impl::ae_vector *,struct alglib_impl::ae_vector *,struct alglib_impl::ae_state *)" (?dsnormalize@alglib_impl@@YAXPAUae_matrix@1@HHPAHPAUae_vector@1@2PAUae_state@1@@Z)

What's the reason??
I hope that the code in the header and cpp files is right!!

Author:  Sergey.Bochkanov [ Wed Oct 13, 2010 2:10 pm ]
Post subject:  Re: Problem compiling empty project - PCA

Looks like you've forgot to include statistics.cpp (file where alglib_impl::calculatemoments is defined) to your project. Am I right? If not, please post archive with your project here.

BTW, you don't have to use namespace alglib_impl; actually, nothing from this namespace is intended to be used directly.

Author:  swagger [ Wed Oct 13, 2010 2:40 pm ]
Post subject:  Re: Problem compiling empty project - PCA

Sergey.Bochkanov wrote:
Looks like you've forgot to include statistics.cpp


Thank you very much. I haven't notice that I've stupidly forgot statistics.cpp.

Sergey.Bochkanov wrote:
BTW, you don't have to use namespace alglib_impl; actually, nothing from this namespace is intended to be used directly.


Thanks for this information. Fortunately, however, add this line doesn't cause any problem. :)
Thanks a lot.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/