The sample C++ code can not be compiled with gcc. But msvc can. I have
tried to make a minimal sample from opencv code
(opencv/modules/videoio/src/cap_obsensor/obsensor_stream_channel_msmf.hpp).
_COM_SMARTPTR_TYPEDEF macro produces TPtr type alias. It fails with
gcc. If I expand that macro like msvc does and produce TPtr2 type
alias it compiles with gcc. What should I do to troubleshoot the
issue?
#include <iostream>
#include <typeinfo>
#include <windows.h>
#include <comdef.h>
namespace ns {
template <class T>
class ComPtr
{
public:
ComPtr() {}
_COM_SMARTPTR_TYPEDEF(T, __uuidof(T));
typedef _com_ptr_t<_com_IIID<T, &__uuidof(T)>> TPtr2;
TPtr p1;
TPtr2 p2;
};
}
int main()
{
ns::ComPtr<IUnknown> var;
std::cout << typeid(var.p1).name() << "\n";
std::cout << typeid(var.p2).name() << "\n";
}
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public