Windows port (VS 2005)

Lukáš Lalinský lalinsky at gmail.com
Wed Jul 5 09:37:51 CEST 2006


Sebastian Pipping wrote:
[...]
> Also it would be great if someone who already took a closer look
> at the code of these ports could point out the differences between
> them or at least sum up the pros and cons of a single one.

Well, TagLib itself work on Windows just fine. The only problem is that if you
want to compile it with non-gcc compiler, you need to add something like:

#ifdef _WIN32
#  include <windows.h>
#  ifdef _MSC_VER
#    include <io.h>
#    define W_OK 2
#    define R_OK 4
#  else
#    include <unistd.h>
#  endif
#  define ftruncate(a,b) chsize(a,b)
#else
#  include <unistd.h>
#endif

at the begin of toolkit/tfile.cpp. And that's all, now you can compile it with
every Windows compiler.

But each of these ports include lots of __declspec(dllexport) /
__declspec(dllimport) definitions to provide an easy way to export classes to
DLL. Using a .def file is not very easy (impossible, if you are not using some
automatic generator) in C++. The only difference between these three ports is
how many of these exports they contain.

My port [1] also uses Unicode versions of I/O functions, and expects file names
to be in UTF-8 by default, which makes it incompatible with standard Windows
applications.

[1] http://lukas.oxygene.sk/wiki/TagLibWin32



More information about the taglib-devel mailing list