vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

problems compiling the library #1

Closed badboy closed 13 years ago

badboy commented 13 years ago

executing make in the latest checkout:

gcc -c -g -O3 -Wall -Werror -Isrc -Irender   -c -o src/markdown.o src/markdown.c
gcc -c -g -O3 -Wall -Werror -Isrc -Irender   -c -o src/array.o src/array.c
gcc -c -g -O3 -Wall -Werror -Isrc -Irender   -c -o src/buffer.o src/buffer.c
gcc -g -O3 -Wall -Werror -shared -Wl src/markdown.o src/array.o src/buffer.o -o libupskirt.so.1
/usr/bin/ld: src/markdown.o: relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
src/markdown.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libupskirt.so.1] Error 1

adding -fPIC to the Makefile produces:

gcc -c -g -O3 -Wall -Werror -Isrc -Irender -fPIC   -c -o src/markdown.o src/markdown.c
gcc -c -g -O3 -Wall -Werror -Isrc -Irender -fPIC   -c -o src/array.o src/array.c
gcc -c -g -O3 -Wall -Werror -Isrc -Irender -fPIC   -c -o src/buffer.o src/buffer.c
gcc -g -O3 -Wall -Werror -shared -Wl src/markdown.o src/array.o src/buffer.o -o libupskirt.so.1
ln -f -s libupskirt.so.1 libupskirt.so
gcc -c -g -O3 -Wall -Werror -Isrc -Irender -fPIC   -c -o examples/upskirt.o examples/upskirt.c
gcc -c -g -O3 -Wall -Werror -Isrc -Irender -fPIC   -c -o render/xhtml.o render/xhtml.c
cc1: warnings being treated as errors
render/xhtml.c: In function 'ups_toc_renderer':
render/xhtml.c:711:2: error: implicit declaration of function 'memcpy'
render/xhtml.c:711:2: error: incompatible implicit declaration of built-in function 'memcpy'
render/xhtml.c: In function 'ups_xhtml_renderer':
render/xhtml.c:754:2: error: incompatible implicit declaration of built-in function 'memcpy'
make: *** [render/xhtml.o] Error 1

adding #include <string.h> to render/xhtml.c, running make again and it builds fine.

running gcc v4.5.2 on arch linux (64bit)

vmg commented 13 years ago

Thanks, fixed!