-
Notifications
You must be signed in to change notification settings - Fork 14k
Description
I have a custom build.rs script, that attempts to link C and C++ dependencies together. Here is a partial snippet of the build.rs script:
...
let mj_lib_pathbuf = PathBuf::from(path);
let mj_lib_simulate_path = mj_lib_pathbuf.join("libsimulate.a");
println!("cargo::rerun-if-changed={}", mj_lib_simulate_path.canonicalize().unwrap().display());
println!("cargo:rustc-link-search={}", mj_lib_pathbuf.canonicalize().unwrap().display());
#[cfg(feature = "cpp-viewer")]
println!("cargo:rustc-link-lib=simulate");
println!("cargo:rustc-link-lib=mujoco");
...Older Rust versions, which use the system linker (not rust-lld), link without problems.
After upgrading to 1.90, (also tested the nightly version 1.92), I am unable to statically link to C and C++ dependencies.
In fact, looking at the output, it tries to dynamically link to them.
This is what is found in the output: "-Wl,-Bdynamic" "-lsimulate" "-lmujoco".
After trying to explicitly give tell it to statically link (i. e., println!("cargo:rustc-link-lib=static=mujoco");),
the dependencies disappear from the linking command completely.
For reproduction, note that MuJoCo doesn't provide pre-built static libaries. I am testing this on https://github.com/davidhozic/mujoco-static/tree/c7a3aff1, with
cmake -B build -S . -DBUILD_SHARED_LIBS:BOOL=OFF -DMUJOCO_HARDEN:BOOL=OFF -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=ON -DMUJOCO_BUILD_EXAMPLES:BOOL=OFF -DCMAKE_EXE_LINKER_FLAGS:STRING=-Wl,--no-as-needed
cmake --build build --parallel --target libsimulate --config=Release
Meta
rustc --version --verbose:
rustc 1.90.0 (1159e78c4 2025-09-14)
binary: rustc
commit-hash: 1159e78c4747b02ef996e55082b704c09b970588
commit-date: 2025-09-14
host: x86_64-unknown-linux-gnu
release: 1.90.0
LLVM version: 20.1.8
Backtrace (full build output)
Fresh cfg-if v1.0.3
Fresh shlex v1.3.0
warning: unexpected `cfg` condition name: `manual_codegen_check`
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/shlex-1.3.0/src/bytes.rs:353:12
|
353 | #[cfg_attr(manual_codegen_check, inline(never))]
| ^^^^^^^^^^^^^^^^^^^^
|
= help: expected names are: `docsrs`, `feature`, and `test` and 31 more
= help: consider using a Cargo feature instead
= help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(manual_codegen_check)'] }
= help: or consider adding `println!("cargo::rustc-check-cfg=cfg(manual_codegen_check)");` to the top of the `build.rs`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: hiding a lifetime that's elided elsewhere is confusing
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/shlex-1.3.0/src/lib.rs:228:22
|
228 | pub fn quote(in_str: &str) -> Cow<str> {
| ^^^^ -------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
|
228 | pub fn quote(in_str: &str) -> Cow<'_, str> {
| +++
warning: hiding a lifetime that's elided elsewhere is confusing
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/shlex-1.3.0/src/lib.rs:241:26
|
241 | pub fn try_quote(in_str: &str) -> Result<Cow<str>, QuoteError> {
| ^^^^ -------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
241 | pub fn try_quote(in_str: &str) -> Result<Cow<'_, str>, QuoteError> {
| +++
warning: hiding a lifetime that's elided elsewhere is confusing
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/shlex-1.3.0/src/bytes.rs:484:24
|
484 | pub fn quote(in_bytes: &[u8]) -> Cow<[u8]> {
| ^^^^^ --------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
484 | pub fn quote(in_bytes: &[u8]) -> Cow<'_, [u8]> {
| +++
warning: hiding a lifetime that's elided elsewhere is confusing
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/shlex-1.3.0/src/bytes.rs:497:28
|
497 | pub fn try_quote(in_bytes: &[u8]) -> Result<Cow<[u8]>, QuoteError> {
| ^^^^^ --------- the same lifetime is hidden here
| |
| the lifetime is elided here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
help: use `'_` for type paths
|
497 | pub fn try_quote(in_bytes: &[u8]) -> Result<Cow<'_, [u8]>, QuoteError> {
| +++
warning: `shlex` (lib) generated 5 warnings
Fresh find-msvc-tools v0.1.2
Fresh simd-adler32 v0.3.7
warning: unused import: `hash::*`
--> /home/davidhozic/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/simd-adler32-0.3.7/src/lib.rs:87:9
|
87 | pub use hash::*;
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Fresh adler2 v2.0.1
Fresh bitflags v2.9.4
Fresh bitflags v1.3.2
Fresh raw-window-handle v0.6.2
warning: `simd-adler32` (lib) generated 1 warning
Fresh cc v1.2.38
Fresh miniz_oxide v0.8.9
Fresh fdeflate v0.3.7
Fresh cmake v0.1.54
Fresh libc v0.2.175
Fresh zerocopy v0.8.27
Fresh crc32fast v1.5.0
Fresh paste v1.0.15
Fresh getrandom v0.3.3
Fresh ppv-lite86 v0.2.21
Fresh flate2 v1.1.2
Fresh rand_core v0.9.3
Fresh png v0.18.0
Fresh glfw-sys v5.0.0+3.3.9
Fresh rand_chacha v0.9.0
Fresh glfw v0.59.0
Fresh rand v0.9.2
Compiling mujoco-rs v1.4.0 (/home/davidhozic/repo/mujoco-rs)
Running `CARGO=/home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=cpp_viewer CARGO_CRATE_NAME=cpp_viewer CARGO_MANIFEST_DIR=/home/davidhozic/repo/mujoco-rs CARGO_MANIFEST_PATH=/home/davidhozic/repo/mujoco-rs/Cargo.toml CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='A Rust wrapper around the MuJoCo C library, with a native simple viewer (re-)written in Rust.' CARGO_PKG_HOMEPAGE='https://crates.io/crates/mujoco-rs' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=mujoco-rs CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/davidhozic/mujoco-rs' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=1.4.0 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 CARGO_SBOM_PATH='' LD_LIBRARY_PATH='/home/davidhozic/repo/mujoco-rs/target/release/deps:/home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/davidhozic/repo/mujoco-rs/target/release/build/mujoco-rs-260db0c244466cf5/out /home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name cpp_viewer --edition=2024 examples/cpp_viewer.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=171 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="cpp-viewer"' --cfg 'feature="default"' --cfg 'feature="renderer"' --cfg 'feature="viewer"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("cpp-viewer", "default", "ffi-regenerate", "renderer", "viewer"))' -C metadata=a8fc1b6a645190e2 -C extra-filename=-92a7600d53f3542d --out-dir /home/davidhozic/repo/mujoco-rs/target/release/examples -C strip=debuginfo -L dependency=/home/davidhozic/repo/mujoco-rs/target/release/deps --extern bitflags=/home/davidhozic/repo/mujoco-rs/target/release/deps/libbitflags-fa4c30d7c51d6c19.rlib --extern glfw=/home/davidhozic/repo/mujoco-rs/target/release/deps/libglfw-8a21e09ee73e66c2.rlib --extern mujoco_rs=/home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib --extern paste=/home/davidhozic/repo/mujoco-rs/target/release/deps/libpaste-6559d94354cd2fc3.so --extern png=/home/davidhozic/repo/mujoco-rs/target/release/deps/libpng-3e27322d6e5bc4db.rlib --extern rand=/home/davidhozic/repo/mujoco-rs/target/release/deps/librand-c1c03af051baa5c1.rlib -L native=/home/davidhozic/repo/mujoco-rs/target/release/build/glfw-sys-4d2f446a83b24e21/out/lib -L /home/davidhozic/repo/mujoco-rs/mujoco/build/lib`
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "/tmp/rustcXlQjVY/symbols.o" "<2 object files omitted>" "-Wl,--as-needed" "-Wl,-Bstatic" "/home/davidhozic/repo/mujoco-rs/target/release/deps/{libmujoco_rs-f4a88a899cbe327b,libpng-3e27322d6e5bc4db,libflate2-03294ef527924c16,libminiz_oxide-8b519c465cb9ef78,libfdeflate-74a4d8cf54d34bdd,libsimd_adler32-4f5546eaa1a03c91,libcrc32fast-bd308e097a6ebb3f,libcfg_if-5a4301c208f24f4c,libbitflags-fa4c30d7c51d6c19,libglfw-8a21e09ee73e66c2,libraw_window_handle-e615549e1596dcbe,libbitflags-b570a154e08f9135}.rlib" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib/{libstd-*,libpanic_unwind-*,libobject-*,libmemchr-*,libaddr2line-*,libgimli-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libminiz_oxide-*,libadler2-*,libunwind-*,libcfg_if-*,liblibc-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "-Wl,-Bdynamic" "-lsimulate" "-lmujoco" "-llodepng" "-ltinyxml2" "-lqhullstatic_r" "-lccd" "-lstdc++" "-lX11" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-L" "/tmp/rustcXlQjVY/raw-dylibs" "-B<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld" "-fuse-ld=lld" "-Wl,--eh-frame-hdr" "-Wl,-z,noexecstack" "-L" "/home/davidhozic/repo/mujoco-rs/target/release/build/glfw-sys-4d2f446a83b24e21/out/lib" "-L" "/home/davidhozic/repo/mujoco-rs/mujoco/build/lib" "-L" "<sysroot>/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/davidhozic/repo/mujoco-rs/target/release/examples/cpp_viewer-92a7600d53f3542d" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-Wl,-O1" "-Wl,--strip-debug" "-nodefaultlibs"
= note: some arguments are omitted. use `--verbose` to show all linker arguments
= note: rust-lld: error: undefined symbol: mjv_freeScene
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.06
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.06.rcgu.o:(_$LT$mujoco_rs..wrappers..mj_visualization..MjvScene$u20$as$u20$core..ops..drop..Drop$GT$::drop::ha7abdac53878cbb0) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(core::ptr::drop_in_place$LT$alloc..boxed..Box$LT$mujoco_rs..wrappers..mj_visualization..MjvScene$GT$$GT$::hc0a715470e7f8fa4) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_step
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.02
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.02.rcgu.o:(mujoco_rs::wrappers::mj_data::MjData::step::hb97da7e231503ae2) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_defaultVFS
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::from_xml_string::haf58be871aaf6ffd) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_deleteVFS
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::from_xml_string::haf58be871aaf6ffd) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::from_xml_string::haf58be871aaf6ffd) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::from_xml_string::haf58be871aaf6ffd) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced 2 more times
rust-lld: error: undefined symbol: mj_loadXML
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::from_xml_string::haf58be871aaf6ffd) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_makeData
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(mujoco_rs::wrappers::mj_model::MjModel::make_data::h3ae6d049190aa427) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_deleteData
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.02
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.02.rcgu.o:(_$LT$mujoco_rs..wrappers..mj_data..MjData$u20$as$u20$core..ops..drop..Drop$GT$::drop::hbf533e0990d8010e) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mj_deleteModel
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.00
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.00.rcgu.o:(_$LT$mujoco_rs..wrappers..mj_model..MjModel$u20$as$u20$core..ops..drop..Drop$GT$::drop::hc15f2c04d1172596) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mjv_defaultCamera
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mjv_defaultOption
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mjv_defaultPerturb
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mjv_defaultScene
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mjv_makeScene
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: new_simulate
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mujoco::Simulate::RenderInit()
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mujoco::Simulate::Load(mjModel_*, mjData_*, char const*)
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mujoco::Simulate::RenderStep(bool)
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::launch_passive::hb40de6ee2f70d95d) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::render::h9acf45e01dafd9b7) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mujoco::Simulate::Sync(bool)
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(mujoco_rs::viewer::MjViewerCpp::sync::hb0230bab844bba03) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: mujoco::Simulate::RenderCleanup()
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(_$LT$mujoco_rs..viewer..MjViewerCpp$u20$as$u20$core..ops..drop..Drop$GT$::drop::h02a4c5972d1d4993) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: undefined symbol: free_simulate
>>> referenced by mujoco_rs.ebccdb3b156d8666-cgu.04
>>> mujoco_rs-f4a88a899cbe327b.mujoco_rs.ebccdb3b156d8666-cgu.04.rcgu.o:(_$LT$mujoco_rs..viewer..MjViewerCpp$u20$as$u20$core..ops..drop..Drop$GT$::drop::h02a4c5972d1d4993) in archive /home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib
rust-lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
collect2: error: ld returned 1 exit status
error: could not compile `mujoco-rs` (example "cpp_viewer") due to 1 previous error
Caused by:
process didn't exit successfully: `CARGO=/home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/cargo CARGO_BIN_NAME=cpp_viewer CARGO_CRATE_NAME=cpp_viewer CARGO_MANIFEST_DIR=/home/davidhozic/repo/mujoco-rs CARGO_MANIFEST_PATH=/home/davidhozic/repo/mujoco-rs/Cargo.toml CARGO_PKG_AUTHORS='' CARGO_PKG_DESCRIPTION='A Rust wrapper around the MuJoCo C library, with a native simple viewer (re-)written in Rust.' CARGO_PKG_HOMEPAGE='https://crates.io/crates/mujoco-rs' CARGO_PKG_LICENSE='MIT OR Apache-2.0' CARGO_PKG_LICENSE_FILE='' CARGO_PKG_NAME=mujoco-rs CARGO_PKG_README=README.md CARGO_PKG_REPOSITORY='https://github.com/davidhozic/mujoco-rs' CARGO_PKG_RUST_VERSION='' CARGO_PKG_VERSION=1.4.0 CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_VERSION_MINOR=4 CARGO_PKG_VERSION_PATCH=0 CARGO_PKG_VERSION_PRE='' CARGO_PRIMARY_PACKAGE=1 CARGO_SBOM_PATH='' LD_LIBRARY_PATH='/home/davidhozic/repo/mujoco-rs/target/release/deps:/home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib' OUT_DIR=/home/davidhozic/repo/mujoco-rs/target/release/build/mujoco-rs-260db0c244466cf5/out /home/davidhozic/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name cpp_viewer --edition=2024 examples/cpp_viewer.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=171 --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="cpp-viewer"' --cfg 'feature="default"' --cfg 'feature="renderer"' --cfg 'feature="viewer"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("cpp-viewer", "default", "ffi-regenerate", "renderer", "viewer"))' -C metadata=a8fc1b6a645190e2 -C extra-filename=-92a7600d53f3542d --out-dir /home/davidhozic/repo/mujoco-rs/target/release/examples -C strip=debuginfo -L dependency=/home/davidhozic/repo/mujoco-rs/target/release/deps --extern bitflags=/home/davidhozic/repo/mujoco-rs/target/release/deps/libbitflags-fa4c30d7c51d6c19.rlib --extern glfw=/home/davidhozic/repo/mujoco-rs/target/release/deps/libglfw-8a21e09ee73e66c2.rlib --extern mujoco_rs=/home/davidhozic/repo/mujoco-rs/target/release/deps/libmujoco_rs-f4a88a899cbe327b.rlib --extern paste=/home/davidhozic/repo/mujoco-rs/target/release/deps/libpaste-6559d94354cd2fc3.so --extern png=/home/davidhozic/repo/mujoco-rs/target/release/deps/libpng-3e27322d6e5bc4db.rlib --extern rand=/home/davidhozic/repo/mujoco-rs/target/release/deps/librand-c1c03af051baa5c1.rlib -L native=/home/davidhozic/repo/mujoco-rs/target/release/build/glfw-sys-4d2f446a83b24e21/out/lib -L /home/davidhozic/repo/mujoco-rs/mujoco/build/lib` (exit status: 1)