HElp rescue Orion from MinGW DLL hell
October 13, 2019 1:51 PM   Subscribe

I'm trying to compile some changes I made to 1OOM on WIndows. I've never done this before. I am used to Unix and Mac OS, which are much friendlier to my command-line centered workflow.

THere are instructions provided at this link, which I've followed. I've got to the point of having a working console program, as long as I run it from the Mingw shell. THe moment I try to run it from WIndows, I get errors about missing libreadline, and presumably other DLLs.

THere are instructions about this, which I've tried to follow, but there are no DLLS in /mingw32. The closest I've found is /mingw32/lib/libreadline.dll.a, which is apparently not actually a DLL, but an ar archive. I've unarchived it, which was a mistake, as it dumped a bunch of object files.

If there's another way to get a WIndows console version of this program going, I'd appreciate some help doing so. I've been struggling with the MXE cross compiler for quite a while, and finally gave up and decided to try it on WINdows directly. I want to get some changes to other blind players, who overwhelmingly use WIndows. Hope me, Metafilter. :)
posted by Alensin to Computers & Internet (6 answers total)
So I think you should be able to copy the necessary DLLs from wherever mingw keeps them into the same directory as the output executable. To find them, I'd enable Windows Subsystem for Linux, so that I can use familiar command line tools. Then run something like sudo find /mnt/c -iname libreadline.dll 2>/dev/null.
posted by serathen at 3:21 PM on October 13, 2019

Download Readline.dll for Windows 10, 8.1, 8, 7, Vista and XP.

It seems that MinGW is including a weird (to me) named libreadline.dll.a file. Typically a '.a' file is for static linking versus dynamic linking. It should probably be simply 'libreadline.a' but even then you might have to mess with the Makefile so that it would include the static libreadline objects instead of building in the way that it does where it expects to find the shared '.dll' version of the library.

If in MinGW's shell you can find the environment variables that define the search path for dynamic libraries... there should be a readline.dll in there somewhere. The advice to just do a file search over your whole machine for a file named 'readline.dll' (or libreadline.dll) and you will probably find the dynamic .dll library somewhere. You might have to rename it.

The URL I found has a zip and the contents include a file named 'readline.dll' and a text file named 'How to fix Readline.dll errors -'.

Sorry I don't know much about Windows and MinGW in particular. Good Luck!
posted by zengargoyle at 5:59 PM on October 13, 2019

Another maybe answer. If MinGW's shell has the 'ldd' command available. You can run 'ldd executable-name' and it will dump out a list of the shared libraries that executable-name uses and the path to where it found each shared library. If it works under MinGW's shell, and there is a 'ldd' command, it should show you where to find 'libreadline.dll'.

This is mostly how I'd fumble through it on Linux. YMMV.
posted by zengargoyle at 6:10 PM on October 13, 2019 [1 favorite]

Response by poster: THanks for the suggestions, all. :)

I managed to figure it out by a round-about route, using the MinGW package manager from the command line, which I was already familiar with. TUrn out the DLLsare in /mingw32/bin (?!) which is about the last place i'd look for any library file.

I appreciate all the other suggestions. God willing I won't need to do this very often.
posted by Alensin at 7:37 PM on October 13, 2019 [2 favorites]

You can also try the './configure' with the '--without-readline' option. This should configure without the need for the libreadline.dll. It will also loose your history (up/down arrows) and some advanced line editing capabilities.

A quick check of the source shows readline only being used in one place in ./1oom/src/ui/cmdline/uiinput.c and oh, nevermind you found it. :)
posted by zengargoyle at 7:41 PM on October 13, 2019

Response by poster: Yeah, unfortunately even if I DID disable readline, I'd still have to find the other DLLS, so I might as well keep it around for convenience sake. Glad it was solvable. This is definitely helping me brush up on my C programming chops. :)
posted by Alensin at 8:15 PM on October 13, 2019

« Older Meet the parents, en espaƱol   |   Media recommendations about MRA culture Newer »
This thread is closed to new comments.