Currently experiencing issues with qjsc
.
With qjs index.js
, I receive the expected output:
$ qjs index.js
🎾 Ball hit 1 time(s), wiff!
🎾 Ball hit 2 time(s), waff!
🎾 Ball hit 3 time(s), wiff!
🎾 Ball hit 4 time(s), waff!
🎾 Ball hit 5 time(s), wiff!
🎾 Ball hit 6 time(s), waff!
🎾 Ball hit 7 time(s), wiff!
🎾 Ball hit 8 time(s), waff!
🎾 Ball hit 9 time(s), wiff!
... (ad infinitum)
However when attempting to compile with qjsc
, I receive the following error:
$ qjsc index.js
/tmp/out13043.c:344:16: error: redefinition of 'qjsc_index_size'
const uint32_t qjsc_index_size = 691;
^
/tmp/out13043.c:5:16: note: previous definition is here
const uint32_t qjsc_index_size = 2670;
^
/tmp/out13043.c:346:15: error: redefinition of 'qjsc_index' with a different type: 'const uint8_t [691]'
vs 'const uint8_t [2670]'
const uint8_t qjsc_index[691] = {
^
/tmp/out13043.c:7:15: note: previous definition is here
const uint8_t qjsc_index[2670] = {
^
2 errors generated.
@f5io I found this Gist whilst googling
"error: redefinition of 'qjsc_index_size'"
. My issue turned out to be an outdated version of these files:I naïvely built QuickJS using
make
instead ofmake install
, and manually symlinked the resultingqjsc
binary. When I ranmake install
, the error disappeared and the executable ran perfectly fine.Hope that helps. 👍