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

multiply symbols errors from: Win32Exception(const char* message) #1129

Closed
coinoperated0428 opened this issue Oct 15, 2021 · 4 comments · Fixed by #1130
Closed

multiply symbols errors from: Win32Exception(const char* message) #1129

coinoperated0428 opened this issue Oct 15, 2021 · 4 comments · Fixed by #1130
Labels

Comments

@coinoperated0428
Copy link

coinoperated0428 commented Oct 15, 2021

Getting multiply symbol definition errors that appear to be a result of multiple includes from file:
vcpkg\installed\x64-windows\include\bond\ext\grpc\win_thread_pool.h

namespace detail
    {
        BOND_NORETURN void Win32Exception(const char* message)
        {
            throw std::system_error{
                std::error_code{ static_cast<int>(::GetLastError()), std::system_category() },
                message };
        }

    } // namespace detail

I was able to correct by adding inline specifier to the header file code definition i.e.:
inline BOND_NORETURN void Win32Exception(const char* message)

I'm i missing something fundamental here?

building bond gRPC enabled C++ native app using Visual Studio 2019 Enterprise v16.11.4 using C++17 language standard

@chwarr
Copy link
Member

chwarr commented Oct 15, 2021

Nope, you're not missing anything. That function is indeed missing inline. Care to submit a PR with the fix?

Likely none of the Bond tests use win_thread_pool from different compilation units.

@bhardwajs
Copy link
Contributor

@coinoperated0428 - I just sent a PR to fix this issue.

I think there needs to be a PR to update vcpkg port to pick up the latest changes after this is merged. https://github.com/microsoft/vcpkg/tree/master/ports/bond

@chwarr
Copy link
Member

chwarr commented Oct 18, 2021

Thanks for the PR! Looks good to me, with two minor things.

chwarr pushed a commit that referenced this issue Oct 18, 2021
`bond::ext::grpc::detail::Win32Exception` is not marked inline which could
lead to multiple symbol definition.

Mark that function inline.

Fixes #1129
@chwarr
Copy link
Member

chwarr commented Oct 18, 2021

Fix merged. Thanks, @coinoperated0428 for the report and @bhardwajs for this fix.

I'm not planning to cut a release with the changes in master since 9.0.5 for a while. vcpkg can use arbitrary commits, so I don't expect this to be a problem.

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

Successfully merging a pull request may close this issue.

3 participants