Compiling Apache from source on Ubuntu 9.10 (Karmic Koala)
Posted: November 11th, 2009 | Author: Henry Snoek | Filed under: Open Source Projects | Tags: apache, ubuntu | 1 Comment »Last week my OS got upgraded to Ubuntu 9.10. After that I wanted to compile Apache from source. Unfortunately I got this build error:
htpasswd.c:101: error: conflicting types for ‘getline’
/usr/include/stdio.h:651: note: previous declaration of ‘getline’ was here
make[2]: *** [htpasswd.o] Error 1
/usr/include/stdio.h:651: note: previous declaration of ‘getline’ was here
make[2]: *** [htpasswd.o] Error 1
This is fixed by replacing getline with parseline on line 651 in /usr/include/stdio.h
Kudos to HowtoForge for pointing this out.
I had the same problem in debian ’squeeze’. I fixed the conflict between symbols by renaming ‘getline’ to ‘_getline’ the relevant apache source files. This is safe, since the getline version in apache is not exported by the linker.
Also, if you prefer the first method, don’t forget to rename ‘parseline’ (the name does not actually matter) back to ‘getline’ so other programs can still be compiled with getline from glibc.