DefaultListener fails

Festus Hagen festushagenlists at yahoo.com
Tue Jan 3 13:47:13 UTC 2017


Hi all,

Didn't want to submit a PR, Not sure if this is my issue, a VS issue or a TagLib issue, unable to find much on it.


Win7, VS2015 with CLR, TagLib2.

Having issues with either the Default or MyListener Debug listener when using C++ Windows Forms (CLR).
Win32Console or Win32Projects with CLR do not fail.


The error:
Exception thrown at 0x77725932 (ntdll.dll) in WinFormTagLibManagedTest.exe: 0xC0000005: Access violation reading location 0x0E463E87.


Stack shows only this:
>	CppWinFormTagLibManaged.exe!`anonymous namespace'::`dynamic initializer for 'defaultListener''() Line 63	C++


Tried replacing with MyListener:
#ifndef MYLISTENER_H

#define MYLISTENER_H

#include "tdebuglistener.h"
#include "tstring.h"
#include <Windows.h> // added for VS

class MyListener : public TagLib::DebugListener {
public:
virtual void printMessage(const TagLib::String &msg) {
//std::cerr << "MyListener: " << msg << std::endl; // Original
::OutputDebugStringW(msg.toCWString()); // added for VS
}
};

DebugListener listener;

#endif // MYLISTENER_H


Wright or wrong, not sure, it works with Qt and MinGW, fails in the same place with the following error in VS2015:

>c:\users\tcg\documents\visual studio 2015\projects\cppwinformtaglibmanaged\cppwinformtaglibmanaged\MyListener.h(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\tcg\documents\visual studio 2015\projects\cppwinformtaglibmanaged\cppwinformtaglibmanaged\MyListener.h(20): error C2146: syntax error: missing ';' before identifier 'listener'
1>  MyListener.cpp
1>c:\users\tcg\documents\visual studio 2015\projects\cppwinformtaglibmanaged\cppwinformtaglibmanaged\MyListener.h(20): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\tcg\documents\visual studio 2015\projects\cppwinformtaglibmanaged\cppwinformtaglibmanaged\MyListener.h(20): error C2146: syntax error: missing ';' before identifier 'listener'


Any assistance, tip, pointers, ... welcome.


Thanks
-Enjoy
fh : )_~


More information about the taglib-devel mailing list