View unanswered posts | View active topics
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.
|
Page 1 of 1
|
[ 3 posts ] |
|
Author |
Message |
chengch
|
Post subject: Alglib error :"undefined reference to" in ubuntu with g++4.5 Posted: Tue Aug 30, 2011 12:40 pm |
|
Joined: Tue Aug 30, 2011 12:20 pm Posts: 1
|
I'm new here and trying to make use of alglib. The alg.net told me 'Adding ALGLIB to your project is easy - just pick packages you need and... add them to your project!!" But I can't compile even a simplest example: " #include<stdio.h> #include<iostream> #include "specialfunctions.h" #include "specialfunctions.cpp"
using namespace std;
int main () {
const double x = 2; double y = alglib::besselj0(x);
cout << y << "\n";
return 0; " I got the errors: " undefined reference to `alglib_impl::namesoffunctions. .. .. .. .. " is there anyone who can help me ?
I first find this when i compile my codes (which could be successfully done under visual studio in Win7) under ubuntu with g++4.5.2. So I write a simple test but still get only errors. I' have visited sevaral webs for this problem, and someone told me I should not only include .h but also .cpp files. But you see, it does not work. Should someone knows why and tell me how to use this in linux?
Thanks a lot!
|
|
Top |
|
|
DiaG
|
Post subject: Re: Alglib error :"undefined reference to" in ubuntu with g+ Posted: Sun Mar 04, 2012 5:17 pm |
|
Joined: Sun Mar 04, 2012 5:11 pm Posts: 1
|
I think, that you should add the paths to alglib's src in settings of compiler. In qt (but Windows) I'm add folder with source to project, and this error disappear
|
|
Top |
|
|
Sergey.Bochkanov
|
Post subject: Re: Alglib error :"undefined reference to" in ubuntu with g+ Posted: Mon Mar 05, 2012 8:02 am |
|
|
Site Admin |
Joined: Fri May 07, 2010 7:06 am Posts: 927
|
Hello!
You should compile .cpp files instead of including them. Compile .cpp as a separate object file, include .h - and it should work. Also, you should compile all cpp files - not just ones you need.
|
|
Top |
|
|
|
Page 1 of 1
|
[ 3 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 25 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
|