[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] problem with ode example
From: |
Frank Reininghaus |
Subject: |
Re: [Help-gsl] problem with ode example |
Date: |
Sun, 30 May 2010 10:29:11 +0200 |
User-agent: |
KMail/1.13.1 (Linux/2.6.31.12-0.2-desktop; KDE/4.4.2; x86_64; ; ) |
Hio,
Am Freitag 28 Mai 2010 13:15:46 schrieb gottstew:
> I copied that example (saved as test_ode.c) and it compiled properly
> (using "gcc -Wall -c test_ode.c") and I got the test_ode.o file as
> expected.
The file test_ode.o is not the final executable file, but only an intermediate
result. To get an executable file and run it, you can either
1. Run the following commands:
gcc -Wall -c test_ode.c (like you did)
gcc -o test_ode test_ode.o -lgsl -lgslcblas -lm
The 2nd command calls the so-called linker and produces the executable file
test_ode which you can run with
./test_ode
2. A bit simpler: Run only the command
gcc -o test_ode test_ode.c -lgsl -lgslcblas -lm
This produces the executable file test_ode directly.
You need the first version (which looks a bit more complicated at first sight)
if your source code is split between different files.
You can find these steps in the manual:
http://www.gnu.org/software/gsl/manual/html_node/Compiling-and-Linking.html
http://www.gnu.org/software/gsl/manual/html_node/Linking-programs-with-the-
library.html
Cheers,
Frank