Sooooo confusing using Julia
I don’t understand why the following simple codes doesn’t work at all with error message
AbstractGlidingVehicle not defined.
Even my other custom package is similarly written, but that works.
Note: I’m running code as
+) Please let me know how to develop a custom packages and use them. It’s really confusing, especially paths of files, use of other registered packages, and precompiling with PackageCompiler.jl.
Do I have to install the same registered packages (e.g.,
LinearAlgebra.jl) in all my custom environments? If you can, please share the easiest and clearest way to make and use custom packages…
EDIT: suddenly this code works, and it doesn’t work again with different error…
Note: I’m using rsync and running codes on server.
EDIT2: I may found what raises error (but I don’t know why). Replacing
using Revise; includet("glidingvehicle.jl" in
include("glidingvehicle.jl") works well.
Then, should I re-run julia everytime I change my custom package?
EDIT3: After changing
includet("src/glidingvehicle.jl") also works. Probably the location where I run the code is crucial in Julia, and this makes really confused. Is there any way to fix it? In my case when using Python, I used prefix PYTHONPATH="."`.
using Environment using Test function test_all() gv = GlidingVehicle.AbstractGlidingVehicle() end test_all()
module Environment using Revise includet("glidingvehicle.jl") export GlidingVehicle end
module GlidingVehicle using Parameters export AbstractGlidingVehicle @with_kw mutable struct AbstractGlidingVehicle i::Int64 = 1 end end