forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 8:57 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: unresolved external symbol
PostPosted: Sat Apr 21, 2012 2:58 pm 
Offline

Joined: Sat Apr 21, 2012 2:45 pm
Posts: 3
Hello everybody. I am new here and I just started experimenting with this library. There seem to be a lot of great function included but i struggle to get it running properly. Following chunk of code:

#include "StdAfx.h"
#include <windows.h>
#include "fundamental.h"
#include "matrix.h"
#include <cmath>

#include "ap.h"
#include "linalg.h"
#include "alglibinternal.h"

#include <iostream>
#include <fstream>
#include <cstdlib>

.
.
.

count =12;
alglib::real_2d_array a;
a.setlength(count,9) ;

for ( int i = 0; i < count; i++ )
{
for ( int j = 0; j < 9; j++ )
{
a(i,j) = mat[i][j];
}
}

alglib::ae_int_t m=count;
alglib::ae_int_t n=9;
alglib::ae_int_t uneeded=2;
alglib::ae_int_t vtneeded=2;
alglib::ae_int_t additionalmemory=2;
alglib::real_1d_array w;
alglib::real_2d_array u;
alglib::real_2d_array vt;

alglib::rmatrixsvd(a,m,n,uneeded,vtneeded,additionalmemory,w,u,vt);

.
.
.

Gives me linker errors:

Error 14 fatal error LNK1120: 9 unresolved externals

for instance :

Error 7 error LNK2001: unresolved external symbol "void __clrcall alglib_impl::hqrndunit2(struct alglib_impl::hqrndstate *,double *,double *,struct alglib_impl::ae_state *)" (?hqrndunit2@alglib_impl@@$$FYMXPAUhqrndstate@1@PAN1PAUae_state@1@@Z) linalg.obj

All these errors comes from linalg.obj as mentioned in output window.

I am using visual studio 2008 , c++ , where i added ap.h, linalg.h,alglibinternal.h and ap.cpp, linalg.cpp,alglibinternal.cpp to my project (right click header files -> add->existing file ... ). Is there some other step that I am forgetting about?


Top
 Profile  
 
 Post subject: Re: unresolved external symbol
PostPosted: Sat Apr 21, 2012 4:09 pm 
Offline

Joined: Sat Apr 21, 2012 2:45 pm
Posts: 3
I just figured it out. It needed one additional "alglibmisc.h" header. It might be good idea to include these required references in each section in manual. For example if I found SVD in manual it would have following headers listed:
#include "ap.h"
#include "linalg.h"
#include "alglibinternal.h"
#include "alglibmisc.h"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group