0

Trying to add a "hello world" dynamic module to Nginx in windows using MinGW (msys). The libpcre.a archive file is generating without index. Ranlib and ar -s commands do not work, even though ranlib and ar is present in C:/MinGW/bin. Tried uninstalling and reinstalling the module many times but it is of no help. I am using GCC version 6.3.0. Is there any alternate way to solve this issue?

Vishnu
  • 1
  • Could you just use Linux? You'll may find it's much easier to work with in such a case. – ti7 Aug 13 '20 at 19:24

1 Answers1

0

Why would you use such an ancient version of GCC?

Install MSYS2 and user a recent MinGW-w64 version of GCC (latest is 10.2.0). If you need a standalone version of MinGW-w64 you can get the latest version at http://winlibs.com/.

pcre 8.44 builds fine in this environment when compiling like this:

INSTALLPREFIX=/usr/local
BUILDPLATFORM=i686-w64-mingw32
RUNPLATFORM=i686-w64-mingw32
#BUILDPLATFORM=x86_64-w64-mingw32
#RUNPLATFORM=x86_64-w64-mingw32
./configure --prefix=$INSTALLPREFIX --build=$BUILDPLATFORM --host=$RUNPLATFORM --enable-utf --enable-unicode-properties --enable-pcre8 --enable-pcre16 --enable-pcre32 --enable-newline-is-anycrlf --enable-bsr-anycrlf --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-jit --disable-stack-for-recursion CFLAGS="-O3" CXXFLAGS="-O3" LDFLAGS="-Wl,--enable-auto-import" &&
make install-strip &&
echo Success
Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40
  • I think I have not made my question clear. I am using the "make modules" command in msys to add a dynamic module to Nginx, after building Nginx from source code along with pcre 8.44 and zlib-1.2.11 . It is after giving the "make modules" command, that I am getting the error: libpcre.a:archive has no index.run ranlib to add one. My ./configure command works properly. – Vishnu Aug 17 '20 at 06:18
  • Check out this link: https://stackoverflow.com/questions/2765240/could-not-read-symbols-archive-has-no-index-run-ranlib-to-add-one There the solution was to specify the proper ar command to configure. – Brecht Sanders Aug 17 '20 at 08:52
  • Thank you very much! Will look into this. – Vishnu Aug 17 '20 at 17:38