How to build gnu `libiconv` on & for windows?

谁说我不能喝 提交于 2019-11-29 04:06:00

I found PARK Youngho's How to Build libiconv with Microsoft Visual Studio over at The Code Project to be complete and clean (for VS2010 and GNU libiconv 1.14).

A little addition to your answer. I had the same issue and found that the MinGW + MSYS solution was perfect.

Though, I needed to go a little further and generate also the .lib file in order to be able to link with the resulting dll.

This is what I found:

  • generate a .def file from the dll with dumpbin (a Visual Studio tool).

  • generate the .lib file from the .def with the lib program (Visual Studio tool too)

This allows you to specify some link flags if appropriate. Everything detailed here (I'm not the author of this method): http://wiki.videolan.org/GenerateLibFromDll

I also realized that this lib/dll couple can be linked with both MD and MDd libraries.

Hope that can help people that find this post, like it helped me.

-David

compile them using MinGW using Msys for the environment if needed. MinGW's .a files are apparently, according to the mailing list, the same format as .lib files (just do a rename). You might want to check first to see if the iconv static library is included already in the MinGW download / filesystem.

Edit: it's in msys (C:\msys\1.0\lib), along with:

  • libiconv.a
  • libiconv.dll.a
  • libiconv.la

and additionally

  • libiconv-2.dll (in C:\msys\1.0\local\bin)

Edit: is it in here, the libiconv you need? these versions seem to have MSVC makefiles :) http://www.opensource.apple.com/source/libiconv/

I'm the OP. MSYS is the exact thing what I was looking for.

Just install MinGW & MSYS which contains shell sh.exe & make.exewith which you can configure and generate a Makefile after that you can use make.exe to run it.

Its as simple as that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!