[nmglug] Solar Position Algorithm (SPA)

a a at kaluta.us
Wed Nov 12 04:52:31 PST 2014


   Hi Anthony,
   Thanks for the info and the immediate solution.
   Best, Anthony Kaluta

On 11/11/2014 09:23 PM, Anthony J. Bentley wrote:
> Hi Anthony,
>
> a writes:
>> I did chmod +x on above probably not necessary but same result as w/o chmod
> chmod +x isn't necessary here. Doesn't make any difference in the result.
>
>> a at a-laptop:~/Documents/spa$ gcc -o spa_tester spa_tester.c
>> /tmp/ccQbHXvm.o: In function `main':
>> spa_tester.c:(.text+0xc7): undefined reference to `spa_calculate'
>> collect2: error: ld returned 1 exit status
> spa_tester.c calls the spa_calculate() function, but the body of the
> spa_calculate() function is in spa.c. You need to compile both files
> together, like so:
>
> $ cc -o spa_tester spa_tester.c spa.c -lm
>
> This is basically shorthand for the following:
>
> $ cc -c spa_tester.c
> $ cc -c spa.c
> $ ld -o spa_tester -lm spa.o spa_tester.o
>
> This article might be a helpful explanation of what these operations mean:
> http://nethack4.org/blog/building-c.html
>



More information about the nmglug mailing list