Skip to content

Add a guide on how to get a standalone project working, not just the examples #220

Open
@pvini07BR

Description

@pvini07BR

I got the examples working and all, but there isn't a single guide on how to make a standalone project with cargo 3ds new work. All this command does is create a barebones rust project, with no libctru dependency whatsoever. The ctru-rs isn't on crates.io, so I assume I have to clone the repo and add it in the project manually. But even that didn't work. I tried adding this to Cargo.toml of the project:

[dependencies]
ctru-rs = { path = "ctru-rs/ctru-rs" }

and it throws this error when running cargo 3ds run or cargo 3ds build:

[pvini07br@DESKTOP-TISK433 rust-teste]$ cargo 3ds run
Warning: unable to check if `ctru` debuginfo should be linked: unable to parse `--unit-graph` json: EOF while parsing a value at line 1 column 0
stderr: `    Updating crates.io index
    Updating git repository `https://github.com/rust3ds/pthread-3ds.git`
    Updating git repository `https://github.com/rust3ds/shim-3ds.git`
    Updating git repository `https://github.com/rust3ds/ctru-rs.git`
error: failed to select a version for `ctru-sys`.
    ... required by package `pthread-3ds v0.1.0 (https://github.com/rust3ds/pthread-3ds.git#5d9e47ae)`
    ... which satisfies git dependency `pthread-3ds` of package `ctru-rs v0.7.1 (/home/pvini07br/rust-teste/ctru-rs/ctru-rs)`
    ... which satisfies path dependency `ctru-rs` of package `teste v0.1.0 (/home/pvini07br/rust-teste)`
versions that meet the requirements `*` are: 0.5.0

package `ctru-sys` links to the native library `ctru`, but it conflicts with a previous package which links to `ctru` as well:
package `ctru-sys v0.5.0 (/home/pvini07br/rust-teste/ctru-rs/ctru-sys)`
    ... which satisfies path dependency `ctru-sys` of package `ctru-rs v0.7.1 (/home/pvini07br/rust-teste/ctru-rs/ctru-rs)`
    ... which satisfies path dependency `ctru-rs` of package `teste v0.1.0 (/home/pvini07br/rust-teste)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "ctru"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `ctru-sys` which could resolve this conflict
`
    Updating crates.io index
    Updating git repository `https://github.com/rust3ds/pthread-3ds.git`
    Updating git repository `https://github.com/rust3ds/shim-3ds.git`
    Updating git repository `https://github.com/rust3ds/ctru-rs.git`
error: failed to select a version for `ctru-sys`.
    ... required by package `pthread-3ds v0.1.0 (https://github.com/rust3ds/pthread-3ds.git#5d9e47ae)`
    ... which satisfies git dependency `pthread-3ds` of package `ctru-rs v0.7.1 (/home/pvini07br/rust-teste/ctru-rs/ctru-rs)`
    ... which satisfies path dependency `ctru-rs` of package `teste v0.1.0 (/home/pvini07br/rust-teste)`
versions that meet the requirements `*` are: 0.5.0

package `ctru-sys` links to the native library `ctru`, but it conflicts with a previous package which links to `ctru` as well:
package `ctru-sys v0.5.0 (/home/pvini07br/rust-teste/ctru-rs/ctru-sys)`
    ... which satisfies path dependency `ctru-sys` of package `ctru-rs v0.7.1 (/home/pvini07br/rust-teste/ctru-rs/ctru-rs)`
    ... which satisfies path dependency `ctru-rs` of package `teste v0.1.0 (/home/pvini07br/rust-teste)`
Only one package in the dependency graph may specify the same links value. This helps ensure that only one copy of a native library is linked in the final binary. Try to adjust your dependencies so that only one package uses the `links = "ctru"` value. For more information, see https://doc.rust-lang.org/cargo/reference/resolver.html#links.

failed to select a version for `ctru-sys` which could resolve this conflict

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions