Question:Taglib on wince 6.0

Lukáš Lalinský lalinsky at gmail.com
Tue Dec 21 17:00:01 CET 2010


2010/12/21 苗澎锋 <mpf125 at 126.com>:
>
> Hi ALL:
>
> I want to use taglib to extract id3 from media files on wince 6.0. When I
> use VS2005 to build taglib , it have many the same warnings as the follow:
> /toolkit\tfile.h : warning C4251: 'TagLib::FileName::m_name' : class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'TagLib::FileName'
> 1>        with
> 1>        [
> 1>            _Elem=char,
> 1>            _Traits=std::char_traits<char>,
> 1>            _Ax=std::allocator<char>
> 1>        ]
>
> How to resolve this? Has it bad effect to my Application when I use it?
>
> if I modify the class FileName to the followings:
>
> class TAGLIB_API FileName
>   {
>   public:
>     FileName(const wchar_t *name) : m_pwname(name) {}
>     FileName(const char *name) : m_pname(name) {}
>     operator const wchar_t *() const { return m_pwname; }
>     operator const char *() const { return m_pname; }
>   private:
>     const char* m_pname;
>     const wchar_t* m_pwname;
>   };
>
> ,the above warnings do not appear. But I don't know it is ok to use the
> Tablib.dll.

It isn't ok. The allocated memory might have been deleted in the
meantime. I think there are two possible options:

 - Export the STL classes.
 - Make it not require the exported classes. I think it complains
about the inline operators, so if we make these non-inline and compile
them into the DLL binary, it should probably go away.

Lukas


More information about the taglib-devel mailing list