Get link errors when I try to use UNICODE version of TagLib calls

Lukáš Lalinský lalinsky at gmail.com
Sat Oct 9 21:25:37 CEST 2010


On Sat, Oct 9, 2010 at 9:11 PM, Kris Gustafson <kris3927gus at hotmail.com> wrote:
> Hello,
>
> I have compiled TagLib version 1.6.3 using CMake version 2.8.1 and Visual
> Studio Pro 2008 on Windows 7 (x64) to create the tag.dll and tagd.dll (and
> the other files).
>
> When I attempt to instantiate a TagLib::FileName with a wchar_t string in my
> MFC application, I get this link error:
>
> 1>MusicInfoFactory.obj : error LNK2001: unresolved external symbol
> "__declspec(dllimport) public: __thiscall TagLib::FileName::FileName(wchar_t
> const *)" (__imp_??0FileName at TagLib@@QAE at PB_W@Z)
>
> 1>C:\Users\Kris.Kris-Pilar-PC.000\Documents\Visual Studio 2008\Projects\MFC
> Projects\MakeM3U\Debug\MakeM3U.exe : fatal error LNK1120: 1 unresolved
> externals
>
> If I use a char string for the same constructor call, no link error.
>
> Is there some compiler switch or #define I have failed to set correctly?

No, I think it's the problem mentioned here -
http://stackoverflow.com/questions/1520986/open-file-in-taglib-with-unicode-chars-in-filename/1526606#1526606

Basically, the CMake build files have some weird option enabled, which
makes the build incompatible with applications built without that
option.

> Another possible side effect is using the char strings may cause a memory
> leak when I instantiate a TagLib::FileRef object (or it could be
> coincidental.).

Do you have more details on the memory leak? If it leaks memory, I'd
really like to get it fixed.

Lukas


More information about the taglib-devel mailing list