Hi there,
I’m trying to do some native windows rust programming. I’m using native-windows-gui and native-windows-derive to do it, but if I try to mix that with tokio, I get the following:
No entry point found error for GetWindowSubclass. On console, I get:
error: process didn't exit successfully: `C:\source\myprojectanem\target\debug\myprojectname.exe` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)
If I change
#[tokio::main]
async fn main() {
to:
fn main() {
The problem goes away, but obviously I can’t use tokio then.
Any clue what the problem is and how to fix it?
wouldn’t it be better to use
#[cfg(target_os = "windows")]
instead of checking an env variable?Reference: https://doc.rust-lang.org/rust-by-example/attribute/cfg.html
Possibly yes. I’ll check if the results are equivalent.
Edit: Yes, that works.