| Problem with GSL in Eclipse [message #491685] |
Thu, 15 October 2009 09:28  |
Henrik Messages: 1 Registered: October 2009 |
Junior Member |
|
|
Hi everyboda,
so far I only worked with Visual C++ and, because I do not want to reinvent the wheel, wanted to change to eclipse and use the GNU Scientific library (GSL).
This endeavor know took me nearly two working days and I am still kind of stuck.
Step 1:
What did I do:
I installed cygwin with GSL
I installed Eclipse for C++
Result:
The "Hello World" example runs. I can compile it, run it, and get a working stand alone program with a Hello World output.
Step 2: Then I wanted to include gsl.
What did I do:
Wrote a small example programm to test gsl:
#include <iostream>
#include <gsl/gsl_statistics.h>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl;
double data[5] = {17.2, 18.1, 16.5, 18.3, 12.6};
double mean;
mean = gsl_stats_mean(data, 1, 5);
cout << mean << endl;
return 0;
}
Because of receiving numerous errors, I searched the net for some time and finally did the following to include the gsl header (found here: http://www.eclipse.org/forums/index.php?t=msg&goto=23130 3&S=e12b33cc44ec8098c3abf3d5a3bc9056#msg_231303):
1) Added the gsl folder to to Project Properties -> C/C++ General -> Paths and Symbols -> Include for both GC and Gnu C and Gnu C++ languages
2) Added 'gsl' to Project Properties -> C/C++ Build -> Settings -> Tool Settings -> Cygwin C++ Linker -> Libraries -> Libraries
3) Added the gsl folder to Project Properties -> C/C++ Build -> Settings -> Tool Settings -> CygWin C++ Linker -> Libraries -> Library Search Path
Now, the error messages disappear and the compiler compiles. However, nothing happens. The console stays empty.
If I comment out the line using the gsl function, the program runs again.
I tried to donwload another version of gsl (GnuWin32), but the problem stays the same.
Does anybody has a hint of how to proceed? Do I include the files in the correct way?
Thanks a lot,
Henrik
|
|
|
|
|
|
|
| Re: Problem with GSL in Eclipse [message #633517 is a reply to message #557831] |
Mon, 18 October 2010 06:15   |
unsown Messages: 3 Registered: October 2010 |
Junior Member |
|
|
This method seems no use for the GSL case.
I don't understand why the console behaves differently when there is a function called in the main()?
| Axel Mueller wrote on Thu, 09 September 2010 03:00 | This is a well known problem with the console output of Eclipse on Windows. There are two possible workarounds:
- add fflush() after every printf/scanf
- add the following command in your main routine
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
This will disable the console buffering.
I added this to the CDT FAQ
|
[Updated on: Mon, 18 October 2010 08:30] Report message to a moderator
|
|
|
|
| Re: Problem with GSL in Eclipse [message #633947 is a reply to message #633724] |
Tue, 19 October 2010 21:16   |
unsown Messages: 3 Registered: October 2010 |
Junior Member |
|
|
Thanks for the response.
I'm working on WinXP-32. Actually, I have no problem get the output from the code post here:
http://www.eclipse.org/forums/index.php?t=msg&goto=62987 2&S=6ee034734ea8d59067ac5a5bdb3e7fef
I found the issue is raised only when libraries libgsl-0.dll and libgslcblas-0.dll of GSL: are linked to the program, even if those are not called by any function at all.
| Axel Mueller wrote on Tue, 19 October 2010 02:44 | | unsown wrote on Mon, 18 October 2010 12:15 | This method seems no use for the GSL case.
I don't understand why the console behaves differently when there is a function called in the main()?
| Axel Mueller wrote on Thu, 09 September 2010 03:00 | This is a well known problem with the console output of Eclipse on Windows. There are two possible workarounds:
- add fflush() after every printf/scanf
- add the following command in your main routine
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
This will disable the console buffering.
I added this to the CDT FAQ
|
|
Do you use Win64? See
http://www.eclipse.org/forums/index.php?t=msg&goto=62987 2&S=6ee034734ea8d59067ac5a5bdb3e7fef
https://bugs.eclipse.org/bugs/show_bug.cgi?id=236330
|
|
|
|
|
|
|
|
|
| Re: Problem with GSL in Eclipse [message #857092 is a reply to message #856419] |
Thu, 26 April 2012 04:31   |
Axel Mueller Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Beau Webber wrote on Wed, 25 April 2012 18:36
I believe a fix for the above is given in the following forum item :
https: //bugs.eclipse.org/bugs/show_bug.cgi?id=236330
As I say, I am very new to IDEs and to Eclipse in particular - can anyone tell me what I do with the files I unpack from the org.eclipse.cdt.repo.zip file that this points to ?
cheers,
Beau Webber
The fix is included in the latest release 8.0.1 Indigo. Just update your Eclipse installation.
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
| Re: Problem with GSL in Eclipse [message #857132 is a reply to message #857092] |
Thu, 26 April 2012 05:12   |
Hagen Messages: 90 Registered: April 2010 |
Member |
|
|
> Beau Webber wrote on Wed, 25 April 2012 18:36
>> I believe a fix for the above is given in the following forum item :
>> https: //bugs.eclipse.org/bugs/show_bug.cgi?id=236330
On 4/26/2012 10:31 AM, Axel Mueller wrote:
> The fix is included in the latest release 8.0.1 Indigo. Just update your
> Eclipse installation.
Updating might not work. OP is trying to get a modified Eclipse
installation from Altera (for Nios II) to work on Win/64bit:
> On 4/26/2012 1:23 AM, Beau Webber wrote:
> Any suggestions how I can install a more recent (64bit compatible)
> version without losing all the Altera configuration info ?
If Altera does not provide a version for Win7/64bit,
you could install a 32bit Java Runtime on Win7/64bit
and use the Altera-provided Eclipse installation with this.
Make sure you start Altera's Eclipse installation
with the 32bit Java VM, and you should be fine.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02097 seconds