Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building xeus failed with Visual Studio 2019 due to implicit conversion failed #194

Closed
LilyWangL opened this issue Dec 9, 2019 · 3 comments

Comments

@LilyWangL
Copy link
Contributor

When I build xeus with Visual Studio 2019, it built failed and I got this error:

xeus\src\ee70dfa02b-e9875865ca\src\xkernel_configuration.cpp(28): error C2593: 'operator =' is ambiguous
xeus\src\ee70dfa02b-e9875865ca\src\xkernel_configuration.cpp(29): error C2593: 'operator =' is ambiguous
xeus\src\ee70dfa02b-e9875865ca\src\xkernel_configuration.cpp(38): error C2593: 'operator =' is ambiguous

This is source code in xkernel_configuration.cpp:

        std::ifstream ifs(file_name);

        nl::json doc;
        ifs >> doc;

        xconfiguration res;
        res.m_transport = doc["transport"];
        res.m_ip = doc["ip"];
        res.m_control_port = std::to_string(doc["control_port"].get<int>());
        res.m_shell_port = std::to_string(doc["shell_port"].get<int>());
        res.m_stdin_port = std::to_string(doc["stdin_port"].get<int>());
        res.m_iopub_port = std::to_string(doc["iopub_port"].get<int>());
        res.m_hb_port = std::to_string(doc["hb_port"].get<int>());
        res.m_signature_scheme = doc.value("signature_scheme", "");
        if (res.m_signature_scheme != "")
        {
            res.m_key = doc["key"];
        }
        else
        {
            res.m_key = "";
        }

The type of res.m_transport is string. When converting nl::json doc to string, it failed. I try to modify doc["transport"] to doc["transport"].get<std::string>(), it build successfully. But I don't know this change is correct or not. Who can help me to confirm it?

Thanks.

@SylvainCorlay
Copy link
Member

Thanks for reporting and opening a PR. This looks like a (yet another) MSVC compiler bug.

I will comment on the PR.

@SylvainCorlay
Copy link
Member

Hey @LilyWangL a PR to xeus core applying the same patch would be very welcome.

Would you be fine with opening one (and enabling VS 2019 in the build matrix?)

@SylvainCorlay
Copy link
Member

This is now fixed in 0.23.3. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants