Open mingodad opened 2 years ago
Trying to compile this sample nullcl -x fib fib.nc:
nullcl -x fib fib.nc
import std.io; int fib(int n) { if(n < 2) return 1; return fib(n-1) + fib(n-2); } int rc = fib(32); io.out << rc << io.endl; return 0;
Fail on Linux due to undefined references to math lib, adding it to nullcl/main.cpp solves it:
math
nullcl/main.cpp
@@ -193,11 +193,14 @@ int main(int argc, char** argv) if(!SearchAndAddSourceFile(pos, tmp)) printf("Failed to find '%s' input file", tmp); } } - + + strcpy(pos, " -lm"); + pos += strlen(pos); + if (verbose) printf("Command line: %s\n", cmdLine); system(cmdLine); }
Trying to compile this sample
nullcl -x fib fib.nc
:Fail on Linux due to undefined references to
math
lib, adding it tonullcl/main.cpp
solves it: