Problem with --threads:on

2022-05-16 Thread morturo
I tried without nimble, using this line `nim c --colors:on --path:C:\Users\psore\.nimble\pkgs\lua-1.0 -o:.\bin\server.exe .\src\main.nim` to compile my server, this will compile the binary and I can run int with no problems, but if I include `--threads:on` and compile it, will run and close imm

Problem with --threads:on

2022-05-15 Thread morturo
This is really strange and disappointing, with a `nim.cfg` inside `src` folder with just `--threads:on` inside I can, inside my "main" nim file have this line `var thread: Thread[int]`, and it will compile but the "Hello World!" message won't appear. If I rename the `nim.cfg` to `package_name.cf

Problem with --threads:on

2022-05-15 Thread Yardanico
I think this is a bug in how Nimble handles alternative paths for resulting binary files. As a workaround instead of creating config file in the subfolder you can create a `nim.cfg` (without anything else in the name) in the root folder of your project.

Problem with --threads:on

2022-05-15 Thread morturo
[nim.cfg](https://i.imgur.com/U5IwpEO.png) [package_name.cfg](https://i.imgur.com/WSse4IT.png) Two prints showing the result, as you can see the `.cfg` file is inside the `src` folder.

Problem with --threads:on

2022-05-15 Thread Yardanico
`nim.cfg` will always work if you put it _next_ to your main .nim (not .nimble !) file

Problem with --threads:on

2022-05-15 Thread morturo
I create a new project and did all those steps again, the problem seem to be with the `nim.cfg`, if I'm using `package_name.cfg` it works properly but if I'm using `nim.cfg` it doesn't works.

Problem with --threads:on

2022-05-15 Thread Yardanico
I've just tried creating a new local Nimble binary package: . ├── src │ ├── tot │ ├── tot.cfg │ └── tot.nim ├── tot └── tot.nimble Run `tot.cfg` just has `--threads:on`. And running `nimble run` works here, it just outputs "Hello, World!"

Problem with --threads:on

2022-05-15 Thread morturo
I'm using `nimble run` and I have a `nim.cfg` at `src` folder with `--threads:on` inside.

Problem with --threads:on

2022-05-15 Thread PMunch
Did you forget `-r` after adding threads? Both programs should behave exactly the same when run.

Problem with --threads:on

2022-05-15 Thread r3c
Works fine, what is your build command?

Problem with --threads:on

2022-05-15 Thread morturo
Just started a new project to learn about threads with nim. when isMainModule: echo("Hello, World!") Run When I compile and run it prints "Hello, World!", but if I compile with `--threads:on` nothing happens. What am I missing here?