0

Trying to call the constructor does not allow to assemble the library, because:

error C2614: VlcMediaPlayer: invalid member initialization: "VlcMediaPlayer" is not a base class or member

public ref class VlcMediaPlayer
{
public:
    ...
    explicit VlcMediaPlayer(array<String^>^ args);
    explicit VlcMediaPlayer(array<String^>^ args, LogMessage^ log);
    ...
}
VlcMediaPlayer::VlcMediaPlayer(array<String^>^ args) :
    _vlcData(nullptr),
    _vlcInstance(nullptr),
    _vlcMediaPlayer(nullptr),
    _media(nullptr),
    _pausable(false),
    _isPlaying(false),
    _vlcAudio(nullptr),
    _vlcEvents(nullptr)
    //_vlcVideo(nullptr)
{
    ...
}
VlcMediaPlayer::VlcMediaPlayer(array<String^>^ args, LogMessage^ log) : VlcMediaPlayer(args)
{
    ...
}

How can I call another constructor?

  • @crashmstr: but what about this? https://ideone.com/sSiWmO –  Feb 26 '18 at 14:59
  • It might be a C++/CLI thing or it might be a C++ in Visual Studio thing, but either way it does not appear to like it. So my two suggestions still look to be your best bet. – crashmstr Feb 26 '18 at 15:03
  • Yes, but I think there may still be more options =) –  Feb 26 '18 at 15:07
  • @crashmstr: C++ *does* have forwarding constructors, since C++11, which is no longer new and shiny. – Ben Voigt Feb 26 '18 at 16:28
  • @Yami As a note: to *fix* this for your project, you need to use a newer Visual Studio and/or a newer selected platform toolset (at least VS2013, per the linked answer). I was able to compile similar code with 2015 and 2017, but get the same error with Visual Studio 2010 selected. – crashmstr Feb 26 '18 at 16:59

0 Answers0