microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.23k stars 476 forks source link

Add simple C++ test #3046

Closed kennykerr closed 3 months ago

kennykerr commented 3 months ago

I'd like to add some C++ interop validation without overly complicating the build. Here's a simple example to try out a technique. May need to limit this to MSVC targets on Windows. We'll see what the CI build has to say.

kennykerr commented 3 months ago

This depends on https://github.com/rust-lang/cargo/issues/7825 not becoming an error.

kennykerr commented 3 months ago

Any GNU experts know why this is failing?

The log includes...

"-L" "D:\\a\\windows-rs\\windows-rs\\crates\\targets\\i686_gnu\\lib"
"-lwindows.0.52.0"

... so the lib should be present and yet its failing to find the import:

undefined reference to `_imp__CoTaskMemFree@4'

Works fine with MSVC.

kennykerr commented 3 months ago

Oh well, at least it works with MSVC. 🤷