I have been developing and compiling small, self-contained C/C++ programs OK using myeclipse in the “Generated Makefile Builder” mode. MyEclipse is using the cygwin gcc/g++ compilers on a Windows XP pro, SP2 system. However, I need to link into the GSL libraries that are also downloaded under cygwin. For example, I can compile the following program OK from the command line:
<pre>
#include <stdio.h>
#include <gsl/gsl_sf_bessel.h>
int main (void)
{
double x = 5.0;
double y = gsl_sf_bessel_J0 (x);
printf (“J0(%g) = %.18e\n”, x, y);
return 0;
}
</pre>
But compiling from MyEclipse I get the error:<b>
undefined reference to `_gsl_sf_bessel_J0′
The command options are: <b>
g++ -O0 -g3 -Wall -c -fmessage-length=0 -lgsl
Somehow the function name got mangled with an added underscore, and of course, it doesn’t exist.
Any help would be appreciated.
Lee.