[Eug-lug] late night thoughts on a fragment in C

larry price laprice at gmail.com
Sat Sep 8 13:12:58 PDT 2007


you want to use

gcc C.c -oC -lm

to make it load the library correctly.



On 9/8/07, Fred James <fredjame at fredjame.cnc.net> wrote:
> larry price wrote:
>
> >#include <math.h>
> >#include <stdio.h>
> >main()
> >   {
> >   int i=5;
> >   for(;i;) printf("%c ",(int)(81+7.3*sin(i---5.75)));
> >}
> >
> >certain aspects of computing are fundamentally arbitrary,
> >
> >http://pastebin.com/f1b9fa8dc
> >
> >
> >
> Larry Price
> I may be missing something ... compiling the above (gcc C.c -o C)
> resulted in ...
> ~/tmp/ccKXlIHx.o: In function `main':
> C.c:(.text+0x2d): undefined reference to `sin'
> collect2: ld returned 1 exit status
>
> Could this be a C++ thing? (I followed the link provided and the comment
> style is C++).
> Regards
> Fred James
>
> Mandriva 2007
> gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
>
>
>
> _______________________________________________
> EUGLUG mailing list
> euglug at euglug.org
> http://www.euglug.org/mailman/listinfo/euglug
>


More information about the EUGLUG mailing list