PMunch / wxnim

Nim wrapper for wxWidgets.
MIT License
94 stars 11 forks source link

threads.nim example fails #29

Closed tissatussa closed 4 months ago

tissatussa commented 4 months ago

I'm trying to compile your threads.nim example, as described in the README, but the command nim cpp -c threads.nim fails with this error :

/home/roelof/Compiled/wxnim/examples/genuimacro/threads.nim(7, 11) Error: undeclared identifier: 'Thread'

I use Nim v1.6.18, set by choosenim. This way i can successfully compile controlgallery.nim, being the other example in that genuimacro folder, but what's wrong with Thread ?

[ i'm on Xubuntu 22.04 ]

PMunch commented 4 months ago

In Nim pre-2.0.0 threads have to be explicitly enabled with the --threads:on switch. Just confirmed that running nim cpp --threads:on -r threads.nim works fine.

tissatussa commented 4 months ago

@PMunch you're right, this works .. but i saw that --threads:on option in the nim.cfg file, located in the same folder .. then, what does that .cfg file do ?