Open DatanoiseTV opened 4 years ago
The way the compiler is architected is that rather than compiling/generating single files, a file and all it's dependencies are amalgamated into single file (or group of files, output.cpp and output.h). Rather than compiling each file separately, you have to compile the Vult files you use in your project at the same time. For example:
$ vultc synth1.vult synth2.vult -ccode
That will generate code for the synth1.vult
and synth2.vult
files including their dependencies. If both files use a third file called util.vult
you will get the code for it as well with a single definition. Currently there's no way of generating the code for a single file. I didn't implemented it that way because I found it more convenient, when embedding the code in a project, to have a minimal set of files to compile.
My build script for PlatformIO is compiling my used .vult "modules" independently and if another function uses Util. for example, I get a compiler error from the C++ compiler about redefinition of the Utility functions.
I've tried with "-tables false" for all but the first vult file, but that doesn't fix the issue.
vultc -ccode -i vultinc/phase -i vultinc/util vultsrc/{INFILE} -o gen_{INFILE}
How do I deal with it?