Le mercredi 14 janvier 2015 à 11:59 -0800, J Luis a écrit :
>
> Just a shot in the dark, but if instead of this:
> ctgc_l = tCTC_l(C_NULL)
> ctgc_l.iup_canvas = t
> cdActivate(ctgc_l.iup_canvas)
>
> you do this:
> ctgc_l = tCTC_l(t)
> cdActivate(ctgc_l.iup_canvas)
>
> does it make any difference?
>
> unfortunately, no (and took care to comment line 129)
>
>
> (Please copy/paste the output of the Julia console.)
>
> Also, I guess you've made sure you start from a clean
> workspace? What
> does methods(cdActivate) say?
>
> Yes, I always start from a clean workspace (From the Windows cmd I
> call .jl file that calls the code)
>
>
> adding a @show methods(cdActivate) after line 131
>
> prints
>
> t => Ptr{cdCanvas} @0x0000000021844fe0
> ctgc_l.iup_canvas => Ptr{cdCanvas} @0x0000000021844fe0
> methods(cdActivate) => # 1 method for generic function "cdActivate":
> cdActivate(canvas::Ptr{cdCanvas}) at C:\programs\Gits\IUP.jl\src
> \libcd.jl:701
> ERROR: `cdActivate` has no method matching cdActivate(::Ptr{cdCanvas})
> in CDTestInit at C:\programs\Gits\IUP.jl\examples\cdtest_.jl:134
> in cdtest at C:\programs\Gits\IUP.jl\examples\cdtest_.jl:96
> in include at boot.jl:245
> in include_from_node1 at loading.jl:128
> in process_options at client.jl:285
> in _start at client.jl:354
> while loading C:\programs\Gits\IUP.jl\src\execa.jl
OK, got it. Keno was right: you're actually redefining the cdCanvas type
when calling include("../src/libcd_h.jl"). So you have both IUP.cdCanvas
and cdCanvas.
In Julia 0.4, the fully-qualified names will be printed, which will make
this situation obvious. Though I wonder whether it wouldn't be good to
also print a warning when creating this kind of conflict, either when
loading a package or when defining a new type (whichever happens last).
Or at least when using the type.
Regards