Martijn van Beurden
2013-Jan-24 22:10 UTC
[flac-dev] Anyone tried building FLAC with MSVC?
Hi all, I've been struggling for several weeks to get Microsoft Visual Studio 2005 to build FLAC. MinGW worked fine, but the resulting binary didn't support Cyrillic or Greek characters, so I thought MSVC might cut it. Anyway, I'm not a very good programmer, but I got it working. Probably it's of use to tell what I did 1) Compile ogg and get the library and include tree in the FLAC directory tree (that's in the README) 2) Install NASM (that's in the README too) 3) Install a platform SDK (I chose the one for XP SP2) 4) Set MSVC target to Release 5) Add alloc.h to the grabbag_static source files 6) Replace all occurrences of static inline with static __inline 7) Tell the linker to ignore msvcrt.lib 8) Replace all occurrences of %" PRIu64 " with %I64u (I'm not sure whether that is correct) 9) Uninline all (non-static) inlined function in bitreader.c and bitwriter.c (otherwise the linker complains) As I said, I'm not a very good programmer so I'm not sure whether any of the above changes might induce other problems. Anyway, the resulting flac binary doesn't accept Cyrillic or Greek either (just like the flac 1.2.1 release), so I guess it's not compiler related. Anyway, I'll stick with MinGW in the future :)
On 13-01-24 2:10 PM, Martijn van Beurden wrote:> 6) Replace all occurrences of static inline with static __inlineThis should be done with a global define for 'inline'.> 7) Tell the linker to ignore msvcrt.libVisual Studio tells you to do this, but it's wrong. This probably comes from the libogg and flac projects using different runtime libraries. Make sure you're using release ogg with release flac, and if it still complains, change one of the projects to match the other.j Thanks for trying out the project files! -r
On 1/25/2013 06:10, Martijn van Beurden wrote:> Hi all, > > I've been struggling for several weeks to get Microsoft Visual Studio > 2005 to build FLAC. MinGW worked fine, but the resulting binary didn't > support Cyrillic or Greek characters, so I thought MSVC might cut it.This really has nothing to do with MSVC or MinGW. flac is a plain ANSI application under Windows, you need to set your system locale appropriately for each character set. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 834 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/flac-dev/attachments/20130124/feda7dcf/attachment.pgp
Erik de Castro Lopo
2013-Jan-24 22:47 UTC
[flac-dev] Anyone tried building FLAC with MSVC?
Ralph Giles wrote:> On 13-01-24 2:10 PM, Martijn van Beurden wrote: > > > 6) Replace all occurrences of static inline with static __inline > > This should be done with a global define for 'inline'.+1 Specifically, something like #define inline __inline should go in an appropriate place in include/share/compat.h and any file that needs inline should include that compatibility header.> > 7) Tell the linker to ignore msvcrt.lib > > Visual Studio tells you to do this, but it's wrong. This probably comes > from the libogg and flac projects using different runtime libraries. > Make sure you're using release ogg with release flac, and if it still > complains, change one of the projects to match the other.j > > Thanks for trying out the project files!+1 We're workng towards a release and getting the MSVC project files up-to-date and working is highly desirable. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/