No, the Nim compiler always generates multiple C++ files so that they can
compiled in parallel.
one last question: is there a way to get only one file with the lib files
included (without compiling and linking them) ?
ok, thanks!
You'll need to copy this file beside your .cpp file. This is supposed to be
copied automatically when using `--genScript` (if you're using 1.0.6 it should
work), with latest versions of Nim it doesn't get copied (see
i get this error every time, when i compile my main file :
@msecond.nim.cpp:9:10: fatal error: 'nimbase.h' file not found
#include "nimbase.h"
^~~
1 error generated.
Run
You can use a C++ code beautifier, like astyle, and skip the mangling with
exportc pragma, but for reading only not for code thats actually used.
ok, big thanks for answering so fast! :)
@minimisthupper you can get smaller output if you use -d:release or -d:danger,
but the danger flag is not recommended
Sorry, no. The Nim-generated C and C++ code is ment to be read by - and highly
optimized for - compilers, not humans.
any way to get clean code? my very small nim file is like 400 lines of cpp code
Thanks! :)
nim cpp mynimfile.nim
The c++ code is stored in the nimcache directory, see
[https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory](https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory)
Hi,
is there a way to generate c++ code from my .nim file?
Thanks, Minimisthupper
13 matches
Mail list logo