[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Re: Random number generator: compiling issue on a Mac (10
Re: [Help-gsl] Re: Random number generator: compiling issue on a Mac (10.4.11)
Sat, 11 Apr 2009 21:20:26 +0200
Thunderbird 220.127.116.11 (X11/20090409)
Marco Tului wrote:
> By the way, if I write instead by terminal simply "g++ -c
> random_generator.cpp" I don't receive errors: it seems to be fine. How's
The point is that if you use g++ -c then you are compiling the code to
object form -- not linking it together to form an executable. The -l...
commands tell the compiler what libraries your program needs to link to
-- and hence if you are using the -c option they are superfluous. So,
the compiler, being nice and helpful, tells you that.
You only need to use -lgsl -lgslcblas -lm when you are calling g++ to
link together your object files into an executable.