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
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
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.
[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.
`nim.cfg` will always work if you put it _next_ to your main .nim (not .nimble
!) file
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.
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!"
I'm using `nimble run` and I have a `nim.cfg` at `src` folder with
`--threads:on` inside.
Did you forget `-r` after adding threads? Both programs should behave exactly
the same when run.
Works fine, what is your build command?
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?
11 matches
Mail list logo