liberize / ssc

Convert shell script to binary
GNU General Public License v3.0
63 stars 17 forks source link

Header 'wordexp.h' not found using Termux #11

Closed Rem01Gaming closed 7 months ago

Rem01Gaming commented 7 months ago

This happen while using Termux for compile a shell script, as my attempts to make a working binary on Android environment since binary that compiled on linux won't work in Android, throwing error env: exec mtkfest: No such file or directory.

$ bash ssc -u mtkfest mtkfest.x
mtkfest.cpp:10:10: fatal error: 'wordexp.h' file not found
   10 | #include <wordexp.h>
      |          ^~~~~~~~~~~
1 error generated.
liberize commented 7 months ago

I haven't tested it on android termux environment. Try installing libandroid-wordexp: https://github.com/termux/libandroid-support/issues/8

Rem01Gaming commented 7 months ago

That's kinda works but it throws new errors, now from ld.lld.

$ bash ssc -u mtkfest mtkfest.x
ld.lld: error: undefined symbol: wordexp
>>> referenced by mtkfest.cpp
>>>               /data/data/com.termux/files/usr/tmp/mtkfest-b0ba19.o:(main)

ld.lld: error: undefined symbol: wordfree
>>> referenced by mtkfest.cpp
>>>               /data/data/com.termux/files/usr/tmp/mtkfest-b0ba19.o:(main)
g++: error: linker command failed with exit code 1 (use -v to see invocation)
liberize commented 7 months ago

Try LDFLAGS="-landroid-wordexp" ./ssc ...

Rem01Gaming commented 7 months ago

Thanks working fine now, I've submitted #12 for add Android support. I will use ssc instead shc for my projects now.