Search code examples
windowsgccmingwxerces-c

Error installing XercesC with MinGW


I'm trying to build XercesC-3.1.2 with MinGW.

After running $ mingw32-make in the xerces directory, I get the following error:

mingw32-make[4]: Entering directory '/my/path/to/xerces-c-3.1.2/src'
process_begin: CreateProcess(NULL, /bin/mkdir -p xercesc/util, ...) failed.
make (e=2): The system cannot find the file specified.

Following the XercesC build instructions, I'm running the configure script as

$ ./configure CC=mingw32-gcc CXX=mingw32-g++

but without the variable LDFLAGS=-no-undefined. This is contrary to the build instructions in the XercesC webpage because otherwise the configure script will not work because the flag is not recognized by gcc. The configure script seems to run fine, however. After that, running mingw32-make gives the error above.

My mingw32-make and mingw32-gcc versions are

  • mingw32-gcc/g++ 4.8.1
  • mingw32-make 3.82.90

I tried adding C:\MinGW\libexec\gcc\mingw32\4.8.1 to my PATH, as suggested by Codeblocks, but had no exit.

I also fresh installed MinGW in another machine that has no other compiler (or Cygwin, or anything) and got the same results.


Solution

  • I guess you are using MSYS to run the configure script, so why are you using mingw32-make for the make step? You should run the make step in MSYS too, and use the make which is provided with MSYS. The error message which you see suggests that mingw32-make is unable to resolve the path to /bin/mkdir, which is an MSYS command, and should not be visible outside the MSYS shell process context.

    FWIW, xerces-c-3.1.2 builds OOTB for me, cross-compiling with gcc-4.9.3 and binutils-2.24.1, as follows:

    tar xf ~/Downloads/xerces-c-3.1.2.tar.xz
    mkdir xerces-c-3.1.2/build
    cd xerces-c-3.1.2/build
    ../configure --build=x86_64-linux-gnu --host=mingw32 --prefix=/mingw --enable-static --enable-shared
    ...
    make LDFLAGS=-no-undefined
    make prefix=`pwd`/dist/staged install