Skip to content

Multiple definition of '_imp__InterlockedCompareExchange@12' #724

Open
@ancwrd1

Description

@ancwrd1

I am getting a 'multiple definition' link error for the i686-pc-windows-gnu target. Application uses rusqlite crate and winapi crate. The rusqlite crate compiles a native sqlite code (which contains InterlockedCompareExchange references).

The exact error message is:

  = note: /build/.cargo/registry/src/github.com-1ecc6299db9ec823/winapi-i686-pc-windows-gnu-0.4.0/lib/libwinapi_kernel32.a(dgxabs00740.o):(.idata$5+0x0): multiple definition of `_imp__InterlockedCompareExchange@12'
          /usr/lib/gcc/i686-w64-mingw32/7.3-win32/../../../../i686-w64-mingw32/lib/../lib/libkernel32.a(libkernel32s00755.o):(.idata$5+0x0): first defined here
          collect2: error: ld returned 1 exit status                                                                         

Is that an expected behaviour? I found out that this can be avoided by defining WINAPI_NO_BUNDLED_LIBRARIES environment variable but not sure what side effects it might cause. It's also not very convenient to rely on a particular env variable to build a project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionMore info is needed on this issuewontfixThis issue won't or can't be fixed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions