1

I'm using mingw under ubuntu to create windows executables. I need to use expat. It's not included in the repo, so I gather that I need to install it from sources. Is there an easy way to do this?

vy32
  • 309
  • What is expat? What is your Ubuntu version? How mingw was installed? – N0rbert Oct 02 '21 at 14:08
  • expat is a well-known library for parsing XML. The Ubuntu version doesn't actually seem to matter, because the mingw distribution in 18.04, 19.04, 20.04 and 21.04 all seem quite similar. But point taken. – vy32 Oct 02 '21 at 17:52
  • Mingw is different under different versions of Ubuntu. – vy32 Jan 21 '24 at 19:26

1 Answers1

1

Okay, this was pretty easy:

$ ./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/
$ make
$ sudo make install
vy32
  • 309
  • Please make both question and answer reproducible. Where do you run ./configure and so on. Which Ubuntu version and packages were used. – N0rbert Oct 02 '21 at 14:07
  • A better title would say "compile and install" expat. The rest is self-explanatory once compilation is part of the question. This is because mingw has a custom prefix path that is uses (it's a power cross-compilation library for win32 executables available on Linux, BSD, MacOS and others). Projects requiring it will need to find expat using (generally) library search path, pkg-config or cmake, but due to cross-compilation sandboxing, they need to be in the right location. Furthermore, it instructs the compiler the target architecture (confusingly but properly named --host) – tresf Jan 20 '24 at 17:45
  • Well, I unpacked lib expat into a directory, did a chdir into that directory, and then did the above. Do you want me to add that? – vy32 Jan 21 '24 at 19:26