Finally got gettext to compile in mingw

You have to edit three Makefiles, if I remember correctly, add -I/opt/win/mingw/include to the windres command. Then I had to edit two .rc files, I added “#define _WIN32”.

I assume it’s going to work now, unless there’s a different error. I’ll upload the source folder after it’s done. I could just upload the edited files, but I have a poor memory and don’t remember which files I edited.

Nope, it failed, I need to compile libiconv. That’ll probably require editing more files. I need to take the dog out.

For compiling libiconv. edit the following files:
lib/Makefile (Add -I/opt/win/mingw/include to the windres command, search for .rc in nano.)
windows/libiconv.rc (Place #define _WIN32 before the winver include.)

I’m not going to upload the working Makefiles and .rc files. I’ll upload /opt/win after I get GTK compiled, and the other stuff needed for Nestopia UE.

And you might not need to compile libiconv, you just need the .h file.

Gettext got an error.

Edited another file, added a bunch of #defines to it, without the s. I don’t know what they are supposed to be, so it might be a broken gettext.

Lots of errors, what –prefix did I use? It continues though, so it doesn’t matter. The included libtool keeps saying error. Doesn’t exit though.

See you don’t have to be smart to compile gettext in mingw. You just have to be insane. If you want sudo make install to work, you have to use sudo env “PATH=$PATH” make install.

Looks like glib might be able to be configured now. And glib is finally compiling.

And now, I need pcre.h. Can I just copy it from Ubuntu’s include folder?

You might need a cache file, compiling got an error.

Here’s instructions for compiling GTK and everything required with mingw.

For libffi use:

~/ ./configure --prefix=/opt/win/mingw --host=mingw64

export PKG_CONFIG_PATH=/opt/win/mingw/lib/pkgconfig
export CPATH=/opt/win/mingw/include
export LIBRARY_PATH=/opt/win/mingw/lib
CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ PKG_CONFIG=x86_64-w64-mingw32-pkg-config ID=x86_64-w64-mingw32-ld AR=x86_64-w64-mingw32-ar RANLIB=x86_64-w64-mingw32-ranlib "$@"
gstrfuncs.c:1276:7: error: implicit declaration of function ‘strerror_s’ [-Werror=implicit-function-declaration]
strerror_s (buf, sizeof (buf), errnum);

Is gettext broken? I’ll compile the old version from that site.

Recompiling libiconv. That shouldn’t take as long. Also I compiled it for Windows, according to that site, I should of compiled it for Ubuntu. And those instructions are for using mingw in Windows, I think. So I need to recompile iconv again.

Instructions for building libicu here. That is if you are using Linux or Ubuntu Bash, and mingw64.

To get past the strerror_s error, comment out the if part for it, and change the elif to just if. Then it will do the other else statement. Which compiles. And now I get to edit more rc files.