You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using this crate with qmetaobject on MacOS arm64, I get this strange error:
= note: ld: warning: ignoring file /Users/lysan/edit/target/debug/build/edit-ed5f1e2f905ca358/out/librust_cpp_generated.a, building for macOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 )
Undefined symbols for architecture arm64:
"___cpp_closure_17188711627517009258", referenced from:
edit::main::h358ea517e810126f in edit-5673f38a0ffa045a.3yv251ocyfeukzqw.rcgu.o
ld: symbol(s) not found for architecture arm64
Here's my build.rs (mostly copied from qmetaobject):
/* Copyright (C) 2018 Olivier Goffart <[email protected]> Copyright (C) 2023 Lysander Mealy <[email protected]>Permission is hereby granted, free of charge, to any person obtaining a copy of this software andassociated documentation files (the "Software"), to deal in the Software without restriction,including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantialportions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUTNOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGESOR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/use semver::Version;fnmain(){let qt_include_path = std::env::var("DEP_QT_INCLUDE_PATH").unwrap();let qt_version = std::env::var("DEP_QT_VERSION").unwrap().parse::<Version>().expect("Parsing Qt version failed");letmut config = cpp_build::Config::new();for f in std::env::var("DEP_QT_COMPILE_FLAGS").unwrap().split_terminator(';'){
config.flag(f);}
config.include(&qt_include_path).build("src/main.rs");for minor in7..=15{if qt_version >= Version::new(5, minor,0){println!("cargo:rustc-cfg=qt_{}_{}",5, minor);}}letmut minor = 0;while qt_version >= Version::new(6, minor,0){println!("cargo:rustc-cfg=qt_{}_{}",6, minor);
minor += 1;}}
I cannot explain this bug looking at this code.
The ___cpp_closure_17188711627517009258 is probably the symbol created for your cpp! macro. It should be present in the generated .cpp file, could you check that?
Using this crate with
qmetaobject
on MacOS arm64, I get this strange error:Here's my build.rs (mostly copied from qmetaobject):
and my actual code:
The text was updated successfully, but these errors were encountered: