libconfuse: funopen() unavailable in gcc-mingw-w64-x86-64
In upgrading to libconfuse 3.1, I am now receiving the following error on mingw builds for Windows:
libconfuse.a(libconfuse_la-fmemopen.o): In function `fmemopen':
fmemopen.c:110: undefined reference to `funopen'
This can be reproduced on Debian/Ubuntu by installing the mingw crosscompiler:
sudo apt install gcc-mingw-w64-x86-64
cd confuse
CC=x86_64-w64-mingw32-gcc ./configure --enable-shared=no --disable-examples
make
Then try linking libconfuse.a to a trivial app. Since I never build the libconfuse examples in my Windows builds, I hadn’t realized that they didn’t compile with mingw, but in theory, they could show the issue too. If nothing else, you can see the warning the funopen isn’t defined when compiling fmemopen.c.
I’m not completely sure how best to work around this issue. In the past when I’ve run into uses of fmemopen, it has been pretty easy to remove them, but I don’t think that’s the case here. However, I also don’t know how one would implement fmemopen without funopen. Hence I’m posting here to see if there are any other ideas.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 24 (11 by maintainers)
@troglobit All of my project’s regression tests pass on the Windows build, so I’m good with your PR!
Thank you for this work, 6 years later. Simply thank you.
I’ll try this out tonight. From a brief skim, I expect it to fix the issue for me. Thank you so much for looking into this.