This is not a gsl problem, this is a C / GCC problem. I suggest you become more familiar with C / GCC before starting to use gsl. Go through the whole of this...http://www.cplusplus.com/files/tutorial.pdf. Also go through the book ‘The C Programming Language’ by Brian Kernighan and Dennis Ritchie
On 7 August 2014 07:24, rio <brutalf...@outlook.com> wrote: > > I have another problem with compiling. I have to include file and I don't > know how to write it in g++ command. > > I made a wrong command: > > g++ -Wall -I /usr/local/include/ -I include/ /Users/rio/SgDev/a.cpp > -pthread > > regards, > > On Aug 6, 2014, at 6:15 PM, Emyr James <emyrjam...@gmail.com> wrote: > > there should be a program called gsl-config available after you install it > which helps you get the compiler options right. > > To compile it on 1 line on linux I did... > > gcc `gsl-config --cflags` -o example example.c `gsl-config --libs` > > (note the use of backticks) > > then > > ./example > > to run it > > > > On 6 August 2014 14:39, Emyr James <emyrjam...@gmail.com> wrote: > >> Also, make files are a good thing to use. >> >> >> >> On 6 August 2014 14:20, Emyr James <emyrjam...@gmail.com> wrote: >> >>> Yes...you are not linking the gsl libraries... >>> >>> I think you need to learn a bit more about C and gcc before looking at >>> gsl... >>> >>> >>> On 6 August 2014 14:07, rio <brutalf...@outlook.com> wrote: >>> >>>> >>>> rio:testing rio$ gcc example.o -o example >>>> Undefined symbols for architecture x86_64: >>>> "_gsl_sf_bessel_J0", referenced from: >>>> _main in example.o >>>> ld: symbol(s) not found for architecture x86_64 >>>> clang: error: linker command failed with exit code 1 (use -v to see >>>> invocation) >>>> >>>> >>>> On Aug 6, 2014, at 5:30 PM, Emyr James <emyrjam...@gmail.com> wrote: >>>> >>>> ...object *file*.... >>>> >>>> >>>> >>>> On 6 August 2014 13:59, Emyr James <emyrjam...@gmail.com> wrote: >>>> >>>>> You're trying to execute the object fime instead of the actual >>>>> executable. >>>>> >>>>> Do... >>>>> >>>>> ./example >>>>> >>>>> ... not ... >>>>> >>>>> ./example.o >>>>> >>>>> >>>>> >>>>> On 6 August 2014 13:53, rio <brutalf...@outlook.com> wrote: >>>>> >>>>>> Hi :-) >>>>>> >>>>>> I installed gel by brew in mac os 10.8.6. >>>>>> I want to compile this code : http://codepad.org/Z8uC8KPA >>>>>> >>>>>> This error happened. >>>>>> >>>>>> rio:testing rio$ gcc -Wall -I /usr/local/include/ -c example.c >>>>>> rio:testing rio$ gcc -L/usr/local/lib example.o -lgsl -lgslcblas -lm >>>>>> rio:testing rio$ ./example.o >>>>>> -bash: ./example.o: Permission denied >>>>>> rio:testing rio$ chmod +x example.o >>>>>> rio:testing rio$ ./example.o >>>>>> -bash: ./example.o: Malformed Mach-o file >>>>>> >>>>>> Best regards, >>>>>> Rio >>>>>> >>>>>> >>>>> >>>> >>>> >>> >> > >