Any ideas? - thanks.
# nim 0.14.2
nimble install -y nimx
nim c -r --noMain --threads:on --colors:off testnimx.nim
# File: testnimx.nim
import nimx.window
import nimx.text_field
proc startApp() =
# First create a window. Window is the root of view hierarchy.
var wnd = newWindow(newRect(40, 40, 800, 600))
# Create a static text field and add it to view hierarchy
let label = newLabel(newRect(20, 20, 150, 20))
label.text = "Hello, world!"
wnd.addSubview(label)
# Run the app
runApplication:
startApp()
Hint: class_registry [Processing]
/home/lee/.nimble/pkgs/nimx-0.1/nimx/view.nim(312, 14) template/generic instantiation from here
/home/lee/.nimble/pkgs/nimx-0.1/nimx/class_registry.nim(48, 25) template/generic instantiation from here
/home/lee/.nimble/pkgs/nimx-0.1/nimx/class_registry.nim(31, 32) template/generic instantiation from here
/home/lee/.nimble/pkgs/variant-0.1.0/variant.nim(29, 46) Error: no generic parameters allowed for ref
I tested it @araq
Problem with "devel" is that the current Nim compiler is having problems with:
proc nimxPrivateStringify*[T](v: T): string {.inline.} = $v
proc nimxPrivateStringify*(v: string): string {.inline.} =
result = v
if result.isNil: result = "(nil)"
var currentOffset {.threadvar.}: string
proc logi*(a: varargs[string, nimxPrivateStringify]) {.gcsafe.} =
if currentOffset.isNil: currentOffset = ""
native_log(currentOffset & a.join())
in "system_logger.nim" of nimx.
testnimx.nim(17, 1) template/generic instantiation from here
.../sdl_window.nim(335, 14) Error: attempting to call undeclared routine: 'nimxPrivateStringify'
You can clone and install nimx and then change line 58 in "system_logger.nim" from
proc logi*(a: varargs[string, nimxPrivateStringify]) {.gcsafe.} =
to
proc logi*(a: varargs[string, `$`]) {.gcsafe.} =
as workaround until the compiler gets fixed. This will of course weaken the error reporting of nimx overall.
With the 14.2 I get the same error.
So with devel I now get
nim --version
Nim Compiler Version 0.14.3 (2016-07-11) [Linux: amd64]
Copyright (c) 2006-2016 by Andreas Rumpf
git hash: b668c5e2aaf8db3f646bab0b20239fcb0529dac3
active boot switches: -d:release
...
CC: stdlib_oids
CC: stdlib_endians
Error: execution of an external compiler program 'gcc -c -w -pthread -Iinstalls/Nim/lib -o ./nimcache/ttf_ttf.o ./nimcache/ttf_ttf.c' failed with exit code: 256
./nimcache/ttf_ttf.c: In function ‘stbtt_InitFont’:
./nimcache/ttf_ttf.c:2132:16: error: ‘data’ undeclared (first use in this function)
info0->data = data;
^
./nimcache/ttf_ttf.c:2132:16: note: each undeclared identifier is reported only once for each function it appears in
Compilation exited abnormally with code 1 at Mon Jul 11 22:41:40
I haven't tried OderWat's suggestion yet.
What setup are you running?