# QML and Examples not working

**URL:** <https://discourse.julialang.org/t/qml-and-examples-not-working/124293>\
**Category:** Performance\
**Tags:** package, qml\
**Created:** [December 30, 2024, 10:49pm UTC](https://discourse.julialang.org/t/qml-and-examples-not-working/124293 "2024-12-30T22:49:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [December 30, 2024, 10:49pm UTC](https://discourse.julialang.org/t/qml-and-examples-not-working/124293/1 "2024-12-30T22:49:18Z")

</div>

The [discussion on GUI’s](https://discourse.julialang.org/t/how-to-design-gui-interfaces-in-julia/124159/10) and in particular QML made me interested in trying it out to get a flavour of what it does and how to do it. So I went to the QML.jl page to try some examples. The first time through the gui.jl example ran fine.

Then I started running into problems. Now what I get is shown below. I am running this on Windows 11.

Any suggestions?

```julia
PS C:\data\st\Julia\QML\QmlJuliaExamples\basic> julia --project=.
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.11.2 (2024-12-01)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using QML
Precompiling QML...
  25 dependencies successfully precompiled in 19 seconds. 63 already precompiled.
ERROR: InitError: type RefArray has no field cpp_object
Stacktrace:
  [1] getproperty
    @ .\Base.jl:49 [inlined]
  [2] unsafe_convert(to_type::Type{CxxWrap.CxxWrapCore.CxxPtr{…}}, x::Base.RefArray{Ptr{…}, Vector{…}, Vector{…}})
    @ CxxWrap.CxxWrapCore C:\Users\jakez\.julia\packages\CxxWrap\5IZvn\src\CxxWrap.jl:271
  [3] getargv(a::QML.ArgcArgv)
    @ QML C:\Users\jakez\.julia\packages\QML\ZVeBh\src\QML.jl:133
  [4] __init__ ()
    @ QML C:\Users\jakez\.julia\packages\QML\ZVeBh\src\QML.jl:156
  [5] run_module_init(mod::Module, i::Int64)
    @ Base .\loading.jl:1378
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base .\loading.jl:1366
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{…}, ignore_native::Nothing; register::Bool)
    @ Base .\loading.jl:1254
  [8] _include_from_serialized (repeats 2 times)
    @ .\loading.jl:1210 [inlined]
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128, stalecheck::Bool; reasons::Dict{…}, DEPOT_PATH::Vector{…})
    @ Base .\loading.jl:2057
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base .\loading.jl:2527
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2388
 [12] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [13] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base .\loading.jl:2375
 [15] macro expansion
    @ .\loading.jl:2314 [inlined]
 [16] macro expansion
    @ .\lock.jl:273 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2271
 [18] #invoke_in_world#3
    @ .\essentials.jl:1089 [inlined]
 [19] invoke_in_world
    @ .\essentials.jl:1086 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base .\loading.jl:2260
during initialization of module QML
Some type information was truncated. Use `show(err)` to see complete types.

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [December 30, 2024, 11:34pm UTC](https://discourse.julialang.org/t/qml-and-examples-not-working/124293/2 "2024-12-30T23:34:42Z")

</div>

Did you start Julia with:

```julia
julia --project

```

?  
Did you run:

```julia
using Pkg
Pkg.update()

```

?  
For the basic examples you might have to change Project.toml to look like this:

```julia
[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
Observables = "510215fc-4207-5dde-b226-833fc4488ee2"
QML = "2db162a6-7e43-52c3-8d84-290c1c42d82a"
ResumableFunctions = "c5292f4c-5179-55e1-98c5-05642aab7184"

[compat]
ColorTypes = "0.11"
CxxWrap = "0.16"
QML = "0.9"
julia = "1.6"

```

Only required for Julia 1.11, not required for Julia 1.10.

See: [Update README.md, bump dependencies by ufechner7 · Pull Request #15 · barche/QmlJuliaExamples · GitHub](https://github.com/barche/QmlJuliaExamples/pull/15)

---

<div class="post-metadata">

**Author:** ![Jake](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jake/32/46007_2.png) [@Jake](https://discourse.julialang.org/u/Jake)\
**Post date:** [December 31, 2024, 1:18pm UTC](https://discourse.julialang.org/t/qml-and-examples-not-working/124293/3 "2024-12-31T13:18:31Z")

</div>

The only ones I needed to change were

```julia
CxxWrap = "0.16" # from 0.14
QML = "0.9" # from 0.8

```
