shc icon indicating copy to clipboard operation
shc copied to clipboard

Compiled script using -H won't run on other machine.

Open MadTomT opened this issue 5 years ago • 5 comments

Hello SHC 4.0.3

I've compiled my script using: shc -r -H -U -f test.sh -o test

When run on the server it's compiled on it works fine, when run on another server I get 2 lines of output:

sh: cc: command not found
sh: cc: command not found

Looking at the users on both systems they both has there default shell as /bin/bash The script also starts #!/bin/bash

Any idea how to resolve this ? Thanks

MadTomT avatar Feb 19 '20 08:02 MadTomT

I've just rebuilt shc on openSUSE 15.1 Before doing this I tried the following:

CC=/usr/bin/gcc
export CC=/usr/bin/gcc
./configure
make
sudo make install

I then ran shc using:

sudo shc -vrUH -f test.sh -o test

shc shll=bash
shc [-i]=-c
shc [-x]=exec '%s' "$@"
shc [-l]=
shc opts=
shc: cc   test.sh.x.c -o test
shc: strip test
shc: chmod ug=rwx,o=rx test

When test is run on the machine it was built on I get:

linux-18ds:/home/user # ./test
Working OK

On a different machine I get:

./test
Operation not permitted
Killed

When run with sudo I get:

default@linux-c0a9:/home/test> sudo ./test
[sudo] password for root:
sh: cc: command not found
sh: cc: command not found

How do I get this working ? Thanks

MadTomT avatar Feb 20 '20 08:02 MadTomT

I've the same problem. Is there any solution?

khalequzzaman17 avatar Aug 13 '22 00:08 khalequzzaman17

@MadTomT @khalequzzaman17 Did either of you figure out the solution to this problem?

jonathon234234 avatar Mar 07 '23 15:03 jonathon234234

I've not looked at this for a while, but I didn't get it working.

MadTomT avatar Mar 07 '23 16:03 MadTomT

did you try; CFLAGS="-static" shc -r -f input.sh -o output ?

It works for me in simmilar problem.

raniaamina avatar May 08 '23 04:05 raniaamina