forum.alglib.net

ALGLIB forum
It is currently Sun Nov 24, 2024 2:44 am

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  [ 3 posts ] 
Author Message
 Post subject: Including .cpp files.
PostPosted: Tue Feb 19, 2013 2:30 pm 
Offline

Joined: Tue Feb 19, 2013 2:19 pm
Posts: 5
Hello.
I use AlgLib at first. I have a problem: LNK2019: unresolved external symbol ...

There are a lot of similar topics in this disuss. This problem is resolved by including *.cpp file, not .h one. But it's said in manual "By "adding to your project" we mean that you should a) compile .cpp files with the rest of your project, and b) include .h files you need. Do not include .cpp files - these files must be compiled separately, not as part of some larger source file. The only files you should include are .h files, stored in the /src folder of the ALGLIB distribution."

Doesn't work
Code:
#include "ap.h"
alglib::integer_2d_array c("[[1,2,3],[9,9,9]]");
void main () {
}


Works
Code:
#include "ap.cpp"
alglib::integer_2d_array c("[[1,2,3],[9,9,9]]");
void main () {
}


May be I don't understand Manual correctly.


Top
 Profile  
 
 Post subject: Re: Including .cpp files.
PostPosted: Tue Feb 19, 2013 4:37 pm 
Offline

Joined: Mon Feb 18, 2013 6:32 pm
Posts: 3
Hello,

i think, that the problem is in linking. Are you sure, that .cpp(all for sure) files are compiled and linked with your source file?
What compiler and commands(for compiling) do you use? Can you post it?


Top
 Profile  
 
 Post subject: Re: Including .cpp files.
PostPosted: Wed Feb 20, 2013 4:40 am 
Offline

Joined: Tue Feb 19, 2013 2:19 pm
Posts: 5
Eden wrote:
Hello,

i think, that the problem is in linking. Are you sure, that .cpp(all for sure) files are compiled and linked with your source file?
What compiler and commands(for compiling) do you use? Can you post it?


I'm also beginner at c++ programming. I use MVSC++ 2010 Express. And I didn't know that I have to add .cpp files in the left side list besides project folder.

Thank you very much. It's working now.


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 2 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group