yglukhov / nimx

GUI library
MIT License
1.1k stars 75 forks source link

layout_vars.nim: type mismatch #420

Closed mantielero closed 4 years ago

mantielero commented 4 years ago

I am struggling to compile the basic examples in the test folder. I get the following:

$ nim c --threads:on sample01_welcome.nim
....
/home/jose/.nimble/pkgs/nimx-#head/nimx/layout_vars.nim(19, 32) Error: type mismatch: got <Variable>
but expected one of: 
proc newExpression(constant: float = 0): Expression
  first type mismatch at position: 1
  required type for constant: float
  but expression 'left(phs)' is of type: Variable
proc newExpression(term: Term; constant: float = 0): Expression
  first type mismatch at position: 1
  required type for term: Term
  but expression 'left(phs)' is of type: Variable
proc newExpression(terms: seq[Term]; constant: float = 0): Expression
  first type mismatch at position: 1
  required type for terms: seq[Term]
  but expression 'left(phs)' is of type: Variable

I am using: nim 1.2.0. And I am using a mix of versions: I install ttf from github because I was having a similar problem. I installed nimx with nimble install nimx@#head and later from github.

yglukhov commented 4 years ago

Please update kiwi dependency

rm -rf ~/.nimble/pkgs/kiwi-*
nimble install kiwi
yglukhov commented 4 years ago

Also note that the samples are not meant to be compiled on their own. Compile main.nim instead.

mantielero commented 4 years ago

Using nake, I get:

$ nake
/home/jose/src/nimlang/gui/nimx/nimx-master/nimx/private/windows/sdl_window.nim(419, 12) Error: undeclared identifier: 'DisplayEvent'
yglukhov commented 4 years ago

That sounds like an ancient sdl2 dependency. Update it same way as kiwi

mantielero commented 4 years ago

That fixed it. Thanks a lot.