I have installed GNU scientific library (http://www.gnu.org/software/gsl/) which is located in /home/usr/gsl-1.9 and installed statistical programme in /home/usr/statprog

when I tried to compile it, this happens:

$ cd home/usr/statprog 
$ make
gcc -O3 -Wall -Wshadow -pedantic D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o mlRho.o mlRho.c
gcc: error: D_GNU_SOURCE: No such file or directory
make: *** [mlRho.o] Error 1

It says no such file or directory. How to link GNU library to this statprog?


There's a dash (-) missing in the command before D_GNU_SOURCE. Passing -D_GNU_SOURCE to the compiler is equivalent to adding #define _GNU_SOURCE at the start of the c file.

It looks like the Makefile is corrupted somehow. Try

find . -type f -exec grep -lZ D_GNU_SOURCE {} + |
  xargs -r0 perl -pi -e 's/-*D_GNU_SOURCE/-D_GNU_SOURCE/g'

and run make again. However it's likely that something more fundamental is wrong here for that error to have crept in in the first place.

  • Still it shows error. How to link GNU library to this statprog manually? – jack Oct 1 '12 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.