TLmaK0 / rustneat

Rust Neat - NeuroEvolution of Augmenting Topologies
MIT License
68 stars 16 forks source link

Could not find `environment` in `rustneat` #21

Closed henke443 closed 6 years ago

henke443 commented 6 years ago

The sample code in readme.md fails for me with this error:

error[E0432]: unresolved import rustneat::Environment --> src\main.rs:3:5 | 3 | use rustneat::Environment; | ^^^^^^^^^^^^^^^^^^^^^ no Environment in the root

error[E0432]: unresolved import rustneat::Organism --> src\main.rs:4:5 | 4 | use rustneat::Organism; | ^^^^^^^^^^^^^^^^^^ no Organism in the root

error[E0432]: unresolved import rustneat::Population --> src\main.rs:5:5 | 5 | use rustneat::Population; | ^^^^^^^^^^^^^^^^^^^^ no Population in the root

error: cannot continue compilation due to previous error

I haven't programmed in rust for some time so I hope it's not some easy noob misstake on my part but I've tried to fix it for several hours now with no progress.

The things I've done is this:

  1. Created a new directory
  2. cargo init --bin
  3. changed cargo.toml to [dependencies] rustneat = "0.1.8"
  4. Copied sample code from README.md exactly as it is to main.rs and compiled.
  5. Generated above error
henke443 commented 6 years ago

Solved it! By changing the lines to

use rustneat::neat::Environment; use rustneat::neat::Organism; use rustneat::neat::Population;

instead of

use rustneat::Environment; use rustneat::Organism; use rustneat::Population;