[prev in list] [next in list] [prev in thread] [next in thread] 

List:       taglib-devel
Subject:    Re: Initializing TagLib::FileName with a 'const wchar_t *' array
From:       Lukáš Lalinský <lalinsky () gmail ! com>
Date:       2011-08-29 11:02:04
Message-ID: CAGUtLj9bD+P5mHHqvq9x1BHtUVGeuXYpUKhtjgPVgD_u8eqKpQ () mail ! gmail ! com
[Download RAW message or body]

On Mon, Aug 29, 2011 at 12:42 PM, Wolfgang Plaschg
<wolfgang.plaschg@gmail.com> wrote:
> Hello,
> 
> when I try to initialize a TagLib::FileName object with a `const
> wchar_t*` array, I get the following linker error:
> 
> main.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: __thiscall
> TagLib::FileName::FileName(unsigned short const *)"
> (__imp_??0FileName@TagLib@@QAE@PBG@Z) referenced in function _main
> 
> The source I tried to build is nothing more but:
> 
> #include <taglib/mpegfile.h>
> 
> int main(int , char** )
> {
> const wchar_t* wt = L"test.mp3";
> TagLib::FileName filename_w(wt);
> }
> 
> I compiled taglib with MSVC 2008 in debug mode and I'm referencing the
> corresponding debug .lib in my project.
> 
> What strikes me is that the linker tries to link to a
> `TagLib::FileName::Filename(unsigned short const *)` constructor whereas
> I'm using `const wchart_t *`. Everything works fine if I use `const char
> *`.

See the problem described here -
http://stackoverflow.com/questions/1520986/open-file-in-taglib-with-unicode-chars-in-filename/1526606#1526606


If this is with TagLib 1.7, then it's a known problem that TagLib is
compiled with the /Zc:wchar_t- option, which makes MSVC convert
wchar_t as unsigned short. Alternatively, check which flags are you
using to compile your application.

Lukas
_______________________________________________
taglib-devel mailing list
taglib-devel@kde.org
https://mail.kde.org/mailman/listinfo/taglib-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic