I am trying to compile a file using
solcjs from a command-line, and running into various problems.
First of all, I need to supply in the command-line all the files that are imported by the primary file.
Otherwise I get
ParserError: Source "SomeFile.sol" not found: File not supplied initially.
But when I do supply these files, I get a bunch of other problems.
The main issue seems to be the fact the one of the imported files resides in a sub-folder.
First I noticed that I cannot use a backslash, i.e., can only use a slash (I should emphasize that I am running on Windows).
So I've fixed that.
Then I noticed that I cannot use a relative path, i.e., must use the full path of the file.
So I've fixed that too.
I was able to detect and solve these problems by attempting to compile that specific file by itself.
Now back to my original goal - once I specify this file in the list of files passed to
solcjs, I keep getting that
File not supplied initially error.
Here is the command line that I am using:
solcjs --optimize --bin --abi -o build C:/project/util/file1.sol file2.sol main.sol
When I compile each one of the imported files separately, I get
bin files inside the
build output directory:
solcjs --optimize --bin --abi -o build C:/project/util/file1.sol solcjs --optimize --bin --abi -o build file2.sol
But no matter what I do, I am unable to compile the main file.
Compiler version is