This is a discussion on gcc - what's wrong within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> Someone sent me this.... /* Print the Mandlebrot set C code by Glenn Rhoads */ main(){ int x, y, ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Someone sent me this.... /* Print the Mandlebrot set C code by Glenn Rhoads */ main(){ int x, y, k; char *b = " .:,;!/>)|&IH%*#"; float r, i, z, Z, t, c, C; for (y=30; puts(""), C = y*0.1 - 1.5, y-- for (x=0; c = x*0.04 - 2, z=0, Z=0, x++ < 75 for (r=c, i=C, k=0; t = z*z - Z*Z + r, Z = 2*z*Z + i, z=t, k<112; k++) if (z*z + Z*Z > 10) break; printf ("%c", b[k%16]); } } } ....and told me to compile it with gcc but I'm getting all sorts of errors on Slack 7.1 root@Chappell:/home/rob# gcc mandelbrot.c /usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init': elf-init.oS(.text+0xd): undefined reference to `__init_array_end' elf-init.oS(.text+0x12): undefined reference to `__init_array_start' elf-init.oS(.text+0x23): undefined reference to `__init_array_start' /usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_fini': elf-init.oS(.text+0x32): undefined reference to `__fini_array_end' elf-init.oS(.text+0x37): undefined reference to `__fini_array_start' elf-init.oS(.text+0x5b): undefined reference to `__fini_array_start' collect2: ld returned 1 exit status Any ideas what's wrong - it's beyond me. Cheers Rob |
| |||
| Rob wrote: > Someone sent me this.... > Any ideas what's wrong - it's beyond me. add #include <stdio.h> to the start of the c file thats all that is missing, and btw thats so cool fractals in acsi art .................::::::::::::::::::::::::::::::::: :::::::::::............... ............:::::::::::::::::::::::::::::::::::::: ::::::::::::::::.......... .........::::::::::::::::::::::::::::::::::,,,,,,, :::::::::::::::::::....... ......:::::::::::::::::::::::::::::,,,,,,,,,,,,,,, ,,,,,,,:::::::::::::::.... ....::::::::::::::::::::::::::,,,,,,,,,,,,;;;!:H!! ;;;,,,,,,,,:::::::::::::.. :::::::::::::::::::::::::,,,,,,,,,,,,,;;;;!!/>&*|& !;;;,,,,,,,::::::::::::: ::::::::::::::::::::::,,,,,,,,,,,,,;;;;;!!//)|.*#|>/!;;;;;,,,,,,::::::::::: ::::::::::::::::::,,,,,,,,,,,,;;;;;;!!!!//>|: !:|//!!;;;;;,,,,,::::::::: :::::::::::::::,,,,,,,,,,;;;;;;;!!/>>I>>)||I# H&))>////*!;;,,,,:::::::: ::::::::::,,,,,,,,,,;;;;;;;;;!!!!/>H: #| IH&*I#/;;,,,,::::::: ::::::,,,,,,,,,;;;;;!!!!!!!!!!//>|.H: #I>!!;;,,,,:::::: :::,,,,,,,,,;;;;!/||>///>>///>>)|H %|&/;;,,,,,::::: :,,,,,,,,;;;;;!!//)& .;I*,H#&||&/ *)/!;;,,,,,:::: ,,,,,,;;;;;!!!//>)IH:, ## #&!!;;,,,,,:::: ,;;;;!!!!!///>)H%.** * )/!;;;,,,,,:::: H *!|* &>: &)/!!;;;,,,,,:::: ,;;;;!!!!!///>)H%.** * )/!;;;,,,,,:::: ,,,,,,;;;;;!!!//>)IH:, ## #&!!;;,,,,,:::: :,,,,,,,,;;;;;!!//)& .;I*,H#&||&/ *)/!;;,,,,,:::: :::,,,,,,,,,;;;;!/||>///>>///>>)|H %|&/;;,,,,,::::: ::::::,,,,,,,,,;;;;;!!!!!!!!!!//>|.H: #I>!!;;,,,,:::::: ::::::::::,,,,,,,,,,;;;;;;;;;!!!!/>H: #| IH&*I#/;;,,,,::::::: :::::::::::::::,,,,,,,,,,;;;;;;;!!/>>I>>)||I# H&))>////*!;;,,,,:::::::: ::::::::::::::::::,,,,,,,,,,,,;;;;;;!!!!//>|: !:|//!!;;;;;,,,,,::::::::: ::::::::::::::::::::::,,,,,,,,,,,,,;;;;;!!//)|.*#|>/!;;;;;,,,,,,::::::::::: :::::::::::::::::::::::::,,,,,,,,,,,,,;;;;!!/>&*|& !;;;,,,,,,,::::::::::::: ....::::::::::::::::::::::::::,,,,,,,,,,,,;;;!:H!! ;;;,,,,,,,,:::::::::::::.. ......:::::::::::::::::::::::::::::,,,,,,,,,,,,,,, ,,,,,,,:::::::::::::::.... .........::::::::::::::::::::::::::::::::::,,,,,,, :::::::::::::::::::....... ............:::::::::::::::::::::::::::::::::::::: ::::::::::::::::.......... -- One Page Principle: A specification that will not fit on one page of 8.5x11 inch paper cannot be understood. -- Mark Ardis |
| ||||
| > root@Chappell:/home/rob# gcc mandelbrot.c > /usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init': > elf-init.oS(.text+0xd): undefined reference to `__init_array_end' > elf-init.oS(.text+0x12): undefined reference to `__init_array_start' > elf-init.oS(.text+0x23): undefined reference to `__init_array_start' > /usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_fini': > elf-init.oS(.text+0x32): undefined reference to `__fini_array_end' > elf-init.oS(.text+0x37): undefined reference to `__fini_array_start' > elf-init.oS(.text+0x5b): undefined reference to `__fini_array_start' > collect2: ld returned 1 exit status Do you have glibc package installed? This is not an #include issue, it's a library one. I suppose that you have missing glibc for development. Or you have incompatibility between some libraries? -- Claudiu Cismaru |