Thanks for the tip. I guess in a serious project the headers are linked using a
build tool.
Trying to compile _use_c_function.nim_ results in
Error: execution of an external compiler program 'gcc -c -w
-I/home/ftep/.choosenim/toolchains/nim-0.17.2/lib -o
/tmp/cftest/nimcache/use_c_function.o /tmp/cftest/nimcache/use_c_function.c'
failed with exit code: 1
which po
You should tell nim where to look. There is an option --cincludes (try nim
--advanced).
So in your case: nim c --cincludes:"." use_c_function.nim
Hi, I never had time to really test this great language, in consequence I'm a
kind of eternal noob, so I apologize for the trivial problem.
I try to bind a minimal C function for learning purpose.
c_function.h
int addTwo(int x)
{
return x + 2;
}
c_functio