This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: Building libffi with MSVC
Peter, I think you were reading too much into my emails. I never asked you to build anything for me. I simply asked if there were any 'dev' libraries available for MSVC. It's hardly an unreasonable question. Many open source projects provide pre-built dev libraries. It's quite common in my experience.
Anyway, the good news is that with only a little perseverance, it's possible to build libffi-5.dll using only MSVC and no outside tools. After creating the VS project, it's pretty obvious which modules need to get added to it. The only tricky bit was figuring out what to do with win32.S - but even that isn't massively tricky. Also (for anyone building as a DLL) you'll need to create a module definition file (.def file). Unlike MinGW, Visual Studio doesn't generate def files automatically. I found that the easiest way was to use "dumpbin /EXPORTS" on a pre-built version of the DLL and simply edit the resulting file.. There are only a few dozen exported functions so it only takes a minute or so.
I haven't had an opportunity yet to test my DLL so I might move onto the test suite next week.
Thanks for all the suggestions.
John