# Apache Server Frequently Asked Questions

$Revision: 1.1 $ ($Date: 1999/06/24 15:02:51 $)

The latest version of this FAQ is always available from the main Apache web site, at <`http://www.apache.org/docs/misc/FAQ.html`>.

If you are reading a text-only version of this FAQ, you may find numbers enclosed in brackets (such as "[12]"). These refer to the list of reference URLs to be found at the end of the document. These references do not appear, and are not needed, for the hypertext version.

## The Questions

1. Building Apache
   1. Why do I get an error about an undefined reference to "`__inet_ntoa`" or other `__inet_*` symbols?
   2. Why won't Apache compile with my system's `cc`?
   3. Why do I get complaints about redefinition of "`struct iovec`" when compiling under Linux?
   4. I'm using gcc and I get some compilation errors, what is wrong?
   5. I'm using RedHat Linux 5.0, or some other `glibc`-based Linux system, and I get errors with the `crypt` function when I attempt to build Apache 1.2.

## The Answers

### C. Building Apache

1. Why do I get an error about an undefined reference to "`__inet_ntoa`" or other `__inet_*` symbols?

   If you have installed BIND-8 then this is normally due to a conflict between your include files and your libraries. BIND-8 installs its include files and libraries `/usr/local/include/` and `/usr/local/lib/`, while the resolver that comes with your system is probably installed in `/usr/include/` and `/usr/lib/`. If your system uses the header files in `/usr/local/include/` before those in `/usr/include/` but you do not use the new resolver library, then the two versions will conflict.

   To resolve this, you can either make sure you use the include files and libraries that came with your system or make sure to use the new include files and libraries. Adding `-lbind` to the `EXTRA_LDFLAGS` line in your `Configuration` file, then re-running `Configure`, should resolve the problem. (Apache versions 1.2.* and earlier use `EXTRA_LFLAGS` instead.)

   Note:As of BIND 8.1.1, the bind libraries and files are installed under `/usr/local/bind` by default, so you should not run into this problem. Should you want to use the bind resolvers you'll have to add the following to the respective lines:

     `EXTRA_CFLAGS=-I/usr/local/bind/include
     EXTRA_LDFLAGS=-L/usr/local/bind/lib
     EXTRA_LIBS=-lbind`

2. Why won't Apache compile with my system's `cc`?

   If the server won't compile on your system, it is probably due to one of the following causes:

   - The `Configure` script doesn't recognize your system environment.
     This might be either because it's completely unknown or because the specific environment (include files, OS version, et cetera) isn't explicitly handled. If this happens, you may need to port the server to your OS yourself.
   - Your system's C compiler is garbage.
     Some operating systems include a default C compiler that is either not ANSI C-compliant or suffers from other deficiencies. The usual recommendation in cases like this is to acquire, install, and use `gcc`.
   - Your `include` files may be confused.
     In some cases, we have found that a compiler installation or system upgrade has left the C header files in an inconsistent state. Make sure that your include directory tree is in sync with the compiler and the operating system.
   - Your operating system or compiler may be out of revision.
     Software vendors (including those that develop operating systems) issue new releases for a reason; sometimes to add functionality, but more often to fix bugs that have been discovered. Try upgrading your compiler and/or your operating system.

   The Apache Group tests the ability to build the server on many different platforms. Unfortunately, we can't test all of the OS platforms there are. If you have verified that none of the above issues is the cause of your problem, and it hasn't been reported before, please submit a problem report. Be sure to include complete details, such as the compiler & OS versions and exact error messages.

3. Why do I get complaints about redefinition of "`struct iovec`" when compiling under Linux?

   This is a conflict between your C library includes and your kernel includes. You need to make sure that the versions of both are matched properly. There are two workarounds, either one will solve the problem:

   - Remove the definition of `struct iovec` from your C library includes. It is located in `/usr/include/sys/uio.h`. Or,
   - Add `-DNO_WRITEV` to the `EXTRA_CFLAGS` line in your `Configuration` and reconfigure/rebuild. This hurts performance and should only be used as a last resort.

4. I'm using gcc and I get some compilation errors, what is wrong?

   GCC parses your system header files and produces a modified subset which it uses for compiling. This behaviour ties GCC tightly to the version of your operating system. So, for example, if you were running IRIX 5.3 when you built GCC and then upgrade to IRIX 6.2 later, you will have to rebuild GCC. Similarly for Solaris 2.4, 2.5, or 2.5.1 when you upgrade to 2.6. Sometimes you can type "gcc -v" and it will tell you the version of the operating system it was built against.

   If you fail to do this, then it is very likely that Apache will fail to build. One of the most common errors is with `readv`, `writev`, or `uio.h`. This is not a bug with Apache. You will need to re-install GCC.

5. I'm using RedHat Linux 5.0, or some other `glibc`-based Linux system, and I get errors with the `crypt` function when I attempt to build Apache 1.2.

   `glibc` puts the `crypt` function into a separate library. Edit your `src/Configuration` file and set this:

     `EXTRA_LIBS=-lcrypt`

   Then re-run `src/Configure` and re-execute the make.