khchen / wNim

Nim's Windows GUI Framework
MIT License
327 stars 17 forks source link

some codes are failed to be compiled #14

Closed retsyo closed 5 years ago

retsyo commented 5 years ago

I am using latest cloned wNim/winim, latest cloned-and-built nim on win7 64 bits I compile the kinds of examples in your code via nim c -r xx.nim or nim c --threads:on -r xx.nim

dsl.nim

Hint: gdiplus [Processing]
dsl.nim(17, 1) template/generic instantiation of `wNim` from here
dsl.nim(19, 5) Error: defer statement not supported at top level

and I think the other error sources share the simliar problem:

demo.nim

CC: wnim_demo
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\demo_d\wnim_wnim.c.o C:\Users\USER\nimcache\demo_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\demo_d\wnim_wnim.c: In function 'drawPolygon_uj9bsThPSyVmHk8BPYRcrRg':
C:\Users\USER\nimcache\demo_d\wnim_wnim.c:40082:9: error: 'T5_' undeclared (first use in this function)
  (void)(T5_);
         ^~~
C:\Users\USER\nimcache\demo_d\wnim_wnim.c:40082:9: note: each undeclared identifier is reported only once for each function it appears in

dragdrop.nim

CC: wnim_wnim
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\dragdrop_d\wnim_wnim.c.o C:\Users\USER\nimcache\dragdrop_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\dragdrop_d\wnim_wnim.c: In function 'init_gx6K5jmJ70ZIoCilC9a9cEHA':
C:\Users\USER\nimcache\dragdrop_d\wnim_wnim.c:36148:10: error: 'T22_' undeclared (first use in this function)
   (void)(T22_);
          ^~~~
C:\Users\USER\nimcache\dragdrop_d\wnim_wnim.c:36148:10: note: each undeclared identifier is reported only once for each function it appears in

pickicondialog.nim

Hint: gdiplus [Processing]
pickicondialog.nim(189, 7) Hint: 'statusbar' is declared but not used [XDeclaredButNotUsed]
CC: wnim_pickicondialog
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\pickicondialog_d\wnim_pickicondialog.c.o C:\Users\USER\nimcache\pickicondialog_d\wnim_pickicondialog.c' failed with exit code: 1

C:\Users\USER\nimcache\pickicondialog_d\wnim_pickicondialog.c: In function 'showIcons_Pdzn9cJ5kCaQTOWP62ZMbJg':
C:\Users\USER\nimcache\pickicondialog_d\wnim_pickicondialog.c:4310:12: error: 'T31_' undeclared (first use in this function)
     (void)(T31_);
            ^~~~
C:\Users\USER\nimcache\pickicondialog_d\wnim_pickicondialog.c:4310:12: note: each undeclared identifier is reported only once for each function it appears in

reversi.nim

CC: wnim_reversi
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\reversi_d\wnim_wnim.c.o C:\Users\USER\nimcache\reversi_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\reversi_d\wnim_wnim.c: In function 'drawBitmap_xT161lcfQcK5qZmfT9aATXA':
C:\Users\USER\nimcache\reversi_d\wnim_wnim.c:33398:9: error: 'T11_' undeclared (first use in this function)
  (void)(T11_);
         ^~~~
C:\Users\USER\nimcache\reversi_d\wnim_wnim.c:33398:9: note: each undeclared identifier is reported only once for each function it appears in

scribble.nim

CC: wnim_scribble
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\scribble_d\wnim_wnim.c.o C:\Users\USER\nimcache\scribble_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\scribble_d\wnim_wnim.c: In function 'drawBitmap_xT161lcfQcK5qZmfT9aATXA':
C:\Users\USER\nimcache\scribble_d\wnim_wnim.c:35449:9: error: 'T11_' undeclared (first use in this function)
  (void)(T11_);
         ^~~~
C:\Users\USER\nimcache\scribble_d\wnim_wnim.c:35449:9: note: each undeclared identifier is reported only once for each function it appears in

tictactoe.nim

CC: wnim_tictactoe
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples -o C:\Users\USER\nimcache\tictactoe_d\wnim_wnim.c.o C:\Users\USER\nimcache\tictactoe_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\tictactoe_d\wnim_wnim.c: In function 'drawBitmap_xT161lcfQcK5qZmfT9aATXA':
C:\Users\USER\nimcache\tictactoe_d\wnim_wnim.c:33261:9: error: 'T11_' undeclared (first use in this function)
  (void)(T11_);
         ^~~~
C:\Users\USER\nimcache\tictactoe_d\wnim_wnim.c:33261:9: note: each undeclared identifier is reported only once for each function it appears in

autolayout\demo.nim

CC: wnim_demo
Error: execution of an external compiler program 'gcc.exe -c  -w -mno-ms-bitfields -DWIN32_LEAN_AND_MEAN  -IE:\msys64\home\USER\_nim\nim\lib -IR:\khchen-wNim\examples\autolayout -o C:\Users\USER\nimcache\demo_d\wnim_wnim.c.o C:\Users\USER\nimcache\demo_d\wnim_wnim.c' failed with exit code: 1

C:\Users\USER\nimcache\demo_d\wnim_wnim.c: In function 'drawPolygon_uj9bsThPSyVmHk8BPYRcrRg':
C:\Users\USER\nimcache\demo_d\wnim_wnim.c:40082:9: error: 'T5_' undeclared (first use in this function)
  (void)(T5_);
         ^~~
C:\Users\USER\nimcache\demo_d\wnim_wnim.c:40082:9: note: each undeclared identifier is reported only once for each function it appears in
khchen commented 5 years ago

These examples can be compiled by Nim stable release (0.19) . And except dsl.nim, the errors are reported by GCC, not by Nim. So I think there are some bugs in the Nim devel compiler (0.19.9). You can report this to nim's github issue page.

I will try to dig out a way to avoid the bugs if Nim 0.19.9 become stable release and the bugs are still there. But not for now.