Classe d'Exception avec un char* constructeur

Je suis tombé sur le code suivant sur VS2008

if (!CreateProcess( NULL,
                    const_cast<LPWSTR>(ss.str().c_str()),
                    NULL,
                    NULL,
                    FALSE,
                    CREATE_NO_WINDOW|NORMAL_PRIORITY_CLASS,
                    NULL,
                    NULL,
                    &si,
                    &pi))
{
    throw   std::exception("Unable to format Device");
}

Maintenant, je suis portage du code de mingw gcc et je reçois le message d'erreur

error: no matching function for call to 'std::exception::exception(const char [23])'

Enquêter sur la question, j'ai remarqué que Visual Studio dispose d'un fichier d'exception qui, lui, prévoit une exception de la classe et de ne prendre en char*. Certaines des définitions ressembler à ceci

   __CLR_OR_THIS_CALL exception();
    __CLR_OR_THIS_CALL exception(const char *const&);
    __CLR_OR_THIS_CALL exception(const char *const&, int);
    __CLR_OR_THIS_CALL exception(const exception&);
    exception& __CLR_OR_THIS_CALL operator=(const exception&);
    virtual __CLR_OR_THIS_CALL ~exception();
    virtual const char * __CLR_OR_THIS_CALL what() const;

Ma question est comment dois-je contourner ce build question sur mingw gcc ? Dois-je créer une nouvelle classe qui hérite de std::runtime_error et jeter cette place ?

std::exception::exception(const char*) n'est pas un standard c++, plutôt un MS spécifiques de mise en oeuvre en.cppreference.com/w/cpp/error/exception/exception

OriginalL'auteur James Franco | 2015-02-21