Giter Club home page Giter Club logo

Comments (5)

rzerres avatar rzerres commented on June 10, 2024

@goflutterjava please can you recheck using OrbTk's development branch? This will be tagged as "0.3.1-alpha4" soon.

from orbtk.

goflutterjava avatar goflutterjava commented on June 10, 2024

@rzerres When I use the development branch, it raises another error.
image

from orbtk.

rzerres avatar rzerres commented on June 10, 2024

did you go with a

cargo clean
cargo update

it is working for me on x64_86 architecture. Sorry, can't test on OSX.
You may also make use of the bundled feature, as described in the README.md.
I copied you code to orbtk/examples/dev_tools.rs

use orbtk::prelude::*;

fn main() {
    Application::new()
        .window(|ctx| {
            Window::new()
                .title("Dev Tools")
                .position((100.0, 100.0))
                .size(1200.0, 800.0)
                .child(TextBlock::new().text("Dev Tools").build(ctx))
                .build(ctx)
        })
        .run();
}

then called:

cargo run  --features bundled --example dev_tools

from orbtk.

goflutterjava avatar goflutterjava commented on June 10, 2024

I have run

cargo clean
cargo update

it now raise

cargo run --features bundled main.rs
error: none of the selected packages contains these features: bundled

and this is my toml

[package]
name = "dev-tools-rust-orbtk"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#orbtk = "0.3.1-alpha4"
orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop"}

Please take a look when you have time, thanks

from orbtk.

rzerres avatar rzerres commented on June 10, 2024

@goflutterjava
Well, i guess the documentation is a bit misleading here.
The feature flags will be available, if you clone the OrbTk repro and create code in this repostitory. Feature flag "--features bundled" will help to download and build the dependency to sdl2. This is not needed, if you already have a target bound sdl2 library (in your case the OSX build).

If you create your own crate, you are just including the dependency to orbtk. Thus, it will build these crates with the default flags. And here OrbTk will not call the "bundled" feature as a default.

To get that strait

  • your dev-tools-rust-orbtk toml is all fine

  • inside its crate root just call

    cargo run
    

    This will

    • download all defined dependencies

    in this case OrbTK develop branch, ala orbtk-0.3.1.0alpha5, which in turn will require all its dependencies ...

    • complile src/main.rs in debug mode
      since this is the default target and the default source when compiling rust code.

    • will run the compiled and linked executable
      which will be called dev-tools-rust-orbtk, as defined in the toml file.

I just copied the minimal.rs code from orbtk/orbtk/example as src/main.rs to your crate (your code is fine as well). And as expected, i get the rendered window. I can't crosscompile for OSX, sorry.

from orbtk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.