=> PR
[https://github.com/nim-lang/Nim/pull/10011](https://github.com/nim-lang/Nim/pull/10011)
Digging into strings in DLLs a bit more, it turns out the second example does
in fact work. The problem was caused by compiling the DLL with --noMain set.
According to the docs the calling code will have enough time to make a copy
before GC collects the string.
Yeah, day 16 was like a vacation compared to 15. I am back to work debugging 15
now, and I found an issue with my path finding. I think the best approach to
debugging it is visualizations, so I am building out a little interactive mode
that steps through the game step by step visually. Hopefully
I have no plan to add it for now. However, [ZeeGrid](http://www.kycsepp.com/)
may be a solution.
Use [compile
pragma](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma)
or link pragma (below it) to point where the actual implementation code/binary
available.
Minimum example
#include
void greet() {
printf("hello from sub\n");
I tried that, same error thrown by ld.
Don't have linux machine readily so cannot test it. Would try it later.
Hello,
I'm trying to make a [Wren](http://wren.io/) wrapper for Nim, but I have
trouble understanding Nim's FFI. So far I've got a folder structure like this:
src/
- wren.nim
- wren/
- incl/
- wren.h
- wrapper.nim
- vm/(...)
Run
The `src
Moving channel to the global scope(which I don't want anyway) created a new
issue:
GDB arguments(ignore to configure a gdbserver connection instead):
Host(default = localhost):
Port(default = 3000):
Initializing gdb...
Not found...
...
Not found...
Found m
Have you tried using header: h for wrenInitConfiguration's definition?
Also, the channel gets initialized 100% of the time because newGdbRemote()
always worked.
The channel never got closed and removing the only channel closing statement
won't change anything because the error comes from an NPE in the stdlib.
After the "Initializing gdb..." the open will happen.
newGdbRemote never failed - the exception happens after invocing run().
The exception happens at tryRecv()/send() which means it never reached the
stop() method - there was no "Connected to gdbserver!" message either.
Since neither newGdbRem
@mashingan I already tried that and the program crashed again - but I don't
want a global variable anyway.
The error message indicated it's error when you trying sending through the
channel (and usually it's whether closed or not opened yet). Since in your
exception is you already closed the channel, you should check whether
gbdr.isSome or not.
Try putting your channel (line 78) as a global?
While inter-thread data can be exchanged using ptr, it's only working for
simple data struct (cmiiw). And the phrase "channel is supposed be safe" is for
channel that shared among threads, aka it's a global variable.
I have [a
prototype]([https://pastebin.com/fmdXREDK](https://pastebin.com/fmdXREDK)) gdb
interface in nim and the channel always fails at either send() or tryRecv():
GDB arguments(ignore to configure a gdbserver connection instead):
Host(default = localhost):
Port(default =
And the question: is this a bug or am I missing something(which is not in the
docs)?
Version [0.99](https://github.com/Vladar4/libtcod_nim/releases/tag/v0.99)
* adaptation for the current Nim syntax
* added 1.7.0 wrapper (SDL2 support)
* bugfixes for both 1.5.1 and 1.7.0 wrappers
I encountered the same difficulties. The fact that the problem provides several
test cases shows that the creators are aware of the difficulties. There are
several traps to fall into. And, for part 2, there are also performance issues.
For now, this problem has been the most challenging. Day 16
19 matches
Mail list logo