3

I am really struggling with this one. I have downloaded the latest version of each of the following Apache APR products for Windows:

I have extracted the zip files and renamed the directories according to the APR Windows build instructions. Then I opened the apr-util/apr-util.dsw solution within Visual Studio 2017 and performed the required upgrade. When I build, I'm getting a bunch of errors from the apr-util/xml/xml.vcxproj project about missing source files. I have verified that none of the files referenced by the xml project actually exist on disk (or within the zip archive). Those files also don't exist within the Linux source download. Further, all of those files exist in APR-util v1.5.4. In my mind, this leaves only three possibilities:

  1. The version I downloaded is corrupted
  2. Apache released a version that is missing files required to build
  3. There are additional build steps required for this version that are missing from the build instructions

I have verified my download of apr-util against the expected MD5 hash, and even tried downloading from other mirrors to eliminate #1 as a possibility.

This version of apr-util was released 2.5 months ago, so if #2 were the case I expect it would have been fixed by now. Has anyone else successfully built this version of Apache APR?

Jeff G
  • 4,470
  • 2
  • 41
  • 76

1 Answers1

8

Based on issue #61379 opened August 3, it appears Apache removed Expat source code from apr-util. There is now an undocumented, additional step to copy the Source/lib directory from the Expat installation to apr-util/xml/expat/lib prior to building.

Jeff G
  • 4,470
  • 2
  • 41
  • 76
  • Would that mean Expat needs to be installed before apr-util? I'm not sure, because when I tried that I'm getting this error: `checking for APR... no configure: error: APR not found. Please read the documentation.` So is it apr-util installation & then expat or the other way around? – Curious Coder Mar 05 '18 at 14:28
  • Nothing needs to be installed. Simply download the source for the APR products (APR-Util, APR-Iconv, and APR), as well as the source code for Expat. Copy the Expat source code to the path indicated in this answer. Otherwise, the build steps are exactly those defined in the APR build instructions (the link to the Windows build instructions is in the question). – Jeff G Mar 07 '18 at 01:18
  • 1
    I tried this, it doesn't work. I get this error in the first instance: `xml/apr_xml.c:35:19: error: expat.h: No such file or directory` To correct this error, I copied **expat/lib/*.h** to **aprutil/include** directory, so that the expat related headers are available for the Make file. I'm now getting an error at a later stage of the MAKE process: `apr-util/.libs/libaprutil-1.so: undefined reference to XML_ParserCreate apr-util/.libs/libaprutil-1.so: undefined reference to XML_GetErrorCode` – Curious Coder Mar 08 '18 at 14:30
  • 1
    @CuriousCoder Yeah, these steps are only tested on Windows. It appears from your error messages that you are attempting to build on Linux, instead. My guess is there is some environment variable that needs to be set (something like EXPAT_DIST or EXPAT_BIN), but unfortunately, I haven't built on that platform. It is unfortunate that the build guide for APR is so out of date that people have to guess what steps are required to build, regardless of the platform. – Jeff G Mar 08 '18 at 16:26
  • I tried the steps mentioned by you above and bumping into the following error: `-- Could NOT find EXPAT (missing: EXPAT_LIBRARY EXPAT_INCLUDE_DIR)` Is there anyway I can make this work, (by configuring some environment variables or providing build parameters maybe) ? – Curious Coder Mar 21 '18 at 12:38
  • My guess is you need to define those environment variables (`EXPAT_LIBRARY` and `EXPAT_INCLUDE_DIR`) to point to the appropriate directories within the extracted Expat project directory (e.g., run the following commands prior to following the [APR Unix Build Instructions](https://apr.apache.org/compiling_unix.html)): `EXPAT_INCLUDE_DIR=/some/path/to/expat-2.2.5/lib` and `EXPAT_LIBRARY=/some/path/to/expat-2.2.5/lib`. – Jeff G Mar 28 '18 at 02:36