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

Kenlm build failed with error C2678 #308

Closed
LilyWangL opened this issue Nov 4, 2020 · 1 comment
Closed

Kenlm build failed with error C2678 #308

LilyWangL opened this issue Nov 4, 2020 · 1 comment

Comments

@LilyWangL
Copy link

I am a member of Microsoft VCPKG team. In an internal version of Visual Studio, kenlm build failed with error C2678:

E:\repro\binaries.amd64ret\inc\algorithm(7280): error C2678: binary '=': no operator found which takes a left-hand operand of type 'const Proxy' (or there is no acceptable conversion)
        with
        [
            Proxy=lm::ngram::trie::`anonymous-namespace'::PartialViewProxy
        ]
E:\1102\vcpkg\buildtrees\kenlm\src\2b1d91de6b-8796a520fb.clean\lm\trie_sort.cc(47): note: could be 'lm::ngram::trie::`anonymous-namespace'::PartialViewProxy &lm::ngram::trie::`anonymous-namespace'::PartialViewProxy::operator =(const util::ValueBlock &)'
E:\1102\vcpkg\buildtrees\kenlm\src\2b1d91de6b-8796a520fb.clean\lm\trie_sort.cc(42): note: or       'lm::ngram::trie::`anonymous-namespace'::PartialViewProxy &lm::ngram::trie::`anonymous-namespace'::PartialViewProxy::operator =(const lm::ngram::trie::`anonymous-namespace'::PartialViewProxy &)'

This issue due to an internal change in compiler. For fixing this issue, we need to change util/proxy_iterator.hh as below:
Line 80:

Proxy operator*() { return p_; }
const Proxy operator*() const { return p_; }

change to:

Proxy operator*() const { return p_; }

I have added a patch to solve this problem temporarily on VCPKG, the related PR microsoft/vcpkg#14382. I submit this issue and want to fix this error on upstream.

@kpu
Copy link
Owner

kpu commented Nov 4, 2020

Done.

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