Make ошибка 127

I am trying to install shc on Ubuntu 18.04

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar xvfz shc-3.8.9.tgz
cd shc-3.8.9
make

But receive the following error:

cc -Wall  shc.c -o shc
make: cc: Command not found
makefile:31: recipe for target 'shc' failed
make: *** [shc] Error 127

The makefile:

# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall # -O6 -pedantic

#SHELL = /bin/sh

SHCFLAGS = -v -T # Add -T option to allow binary to be traceable

all: shc ask_for_test

shc: shc.c
    $(CC) $(CFLAGS) $@.c -o $@

ask_for_test:
    @echo '***  �Do you want to probe shc with a test script?'
    @echo '***  Please try...   make test'

test: make_the_test ask_for_strings

make_the_test: match.x
    @echo '***  Running a compiled test script!'
    @echo '***  It must show files with substring "sh" in your PATH...'
    ./match.x sh

match.x: shc match
    @echo '***  Compiling script "match"'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -f match

ask_for_strings:
    @echo '***  �Do you want to see strings in the generated binary?'
    @echo '***  Please try...   make strings'

strings: make_the_strings ask_for_expiration

make_the_strings: match.x
    @echo '***  Running: "strings -n 5 'match.x'"'
    @echo '***  It must show no sensible information...'
    strings -n 5 match.x

ask_for_expiration:
    @echo '***  �Do you want to probe expiration date?'
    @echo '***  Please try...   make expiration'

expiration: til_yesterday ask_for_install

til_yesterday: shc match
    @echo '***  Compiling "match" to expired date'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -vv -e `date "+%d/%m/%Y"` -f match
    @echo '***  Running a compiled test script!'
    @echo '***  It must fail showing "./match.x: has expired!"'
    ./match.x

ask_for_install:
    @echo '***  �Do you want to install shc?'
    @echo '***  Please try...   make install'

install: shc
    @echo '***  Installing shc and shc.1 on '$(INSTALL_PATH)
    @echo -n '***   �Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
    install -c -s shc $(INSTALL_PATH)/bin/
    install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/

clean:
    rm -f *.o *~ *.x.c

cleanall: clean
    rm -f shc *.x

I have no idea how to fix this error. Can anyone help?

This semester I got this new subject where we get to work with Discovery STM32 F4, and we are still in the phase of setting it up. But I have this problem in the beginning.

When I try to compile this «blink» code I get this error:

Error 127

So, as I got it so far, we are using this shortcut command «make» to compile code, and we were given instruction to set it up as it’s shown in images below:

Setup]

Can anyone see what’s the problem here?

Paolo's user avatar

Paolo

21.8k6 gold badges39 silver badges69 bronze badges

asked Apr 1, 2016 at 20:59

Emir's user avatar

4

Error 127 means one of two things:

  1. file not found: the path you’re using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct — remember that the current working directory for a random terminal might not be the same for the IDE you’re using. it might be better to just use an absolute path instead.
  2. ldso is not found: you’re using a pre-compiled binary and it wants an interpreter that isn’t on your system. maybe you’re using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).

if the problem is (2), then you can solve it in a few diff ways:

  1. get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn’t suck.
  2. see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  3. build your own cross-compiler using something like crosstool-ng.
  4. you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).

answered Apr 2, 2016 at 1:02

Mike Frysinger's user avatar

Mike FrysingerMike Frysinger

2,8471 gold badge21 silver badges26 bronze badges

2

Terminals are very powerful, regardless of what operating system you’re using. This means that while you can perform just about any OS task with a few commands, you need to know these commands to take advantage of them. Of course, different operating systems use different languages in their terminals as well, meaning you need to decide to have mastery over one or use multiple.

In this article, we’re talking about Make error 127, its causes and what you can do to fix the problem.


What causes Make error 127?

The Make error 127 generally occurs when you’re working with a Go operator-sdk project cloned from Github as the command doesn’t generate the bin directory with the required files to run the Make installation. 

As for code 127, it simply indicates a “command not found” error. Since the initial command hasn’t generated the files required, the Make installation fails as the system can’t find the source files to run or read the command.

Also read: How to fix ‘wget command not found’ issue in Bash?


Depending on what’s causing your error, here are two fixes you can try out.

Reinstall a different version of the Operator-SDK

First up, if the problem is being caused by operator-sdk, we can try either rolling back to version 18.0.0 or pushing forward to the latest version available (assuming the latest version has fixed the bug. 

How Facebook's AI is trying to assist suicide prevention

All you have to do is uninstall operator-sdk using brew or apt-get or whatever package manager you’re using. Once that’s done, we reinstall a different version (either version 18.0.0 or the latest one) as well as the latest version of Go. Keep in mind that if you’re using version 18.0.0 of operator-sdk, we recommend installing version 1.17.6 of Go. 

Finally, check if the bin folder has now been created and if it has, you can go ahead and run your Make installation without any errors. 


Check your PATH variables

Since error 127 also indicates that a command or file required to run a command is missing, try checking your PATH variable to see if the command exists there. Alternatively, a simpler way of doing this is opening a terminal in the root directory of whatever command you want to run and then run the problematic command. 

Also read: Fix: Error:03000086:digital envelope routines::initialization error

I am trying to install shc on Ubuntu 18.04

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar xvfz shc-3.8.9.tgz
cd shc-3.8.9
make

But receive the following error:

cc -Wall  shc.c -o shc
make: cc: Command not found
makefile:31: recipe for target 'shc' failed
make: *** [shc] Error 127

The makefile:

# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall # -O6 -pedantic

#SHELL = /bin/sh

SHCFLAGS = -v -T # Add -T option to allow binary to be traceable

all: shc ask_for_test

shc: shc.c
    $(CC) $(CFLAGS) $@.c -o $@

ask_for_test:
    @echo '***  �Do you want to probe shc with a test script?'
    @echo '***  Please try...   make test'

test: make_the_test ask_for_strings

make_the_test: match.x
    @echo '***  Running a compiled test script!'
    @echo '***  It must show files with substring "sh" in your PATH...'
    ./match.x sh

match.x: shc match
    @echo '***  Compiling script "match"'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -f match

ask_for_strings:
    @echo '***  �Do you want to see strings in the generated binary?'
    @echo '***  Please try...   make strings'

strings: make_the_strings ask_for_expiration

make_the_strings: match.x
    @echo '***  Running: "strings -n 5 'match.x'"'
    @echo '***  It must show no sensible information...'
    strings -n 5 match.x

ask_for_expiration:
    @echo '***  �Do you want to probe expiration date?'
    @echo '***  Please try...   make expiration'

expiration: til_yesterday ask_for_install

til_yesterday: shc match
    @echo '***  Compiling "match" to expired date'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -vv -e `date "+%d/%m/%Y"` -f match
    @echo '***  Running a compiled test script!'
    @echo '***  It must fail showing "./match.x: has expired!"'
    ./match.x

ask_for_install:
    @echo '***  �Do you want to install shc?'
    @echo '***  Please try...   make install'

install: shc
    @echo '***  Installing shc and shc.1 on '$(INSTALL_PATH)
    @echo -n '***   �Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
    install -c -s shc $(INSTALL_PATH)/bin/
    install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/

clean:
    rm -f *.o *~ *.x.c

cleanall: clean
    rm -f shc *.x

I have no idea how to fix this error. Can anyone help?

I am trying to teach myself gnuMake after learning the basics of C++

I am running Ubuntu 14.04 equivalent (elementary os)

And I am getting the error (full output of make run):

g++ ./main.o -w  -o test
This is a test!
/bin/sh: 1: This: not found
make: *** [exe] Error 127

My Makefile:

CC=g++
SRC=$(shell find -name '*.cpp')
OBJS= $(SRC:.cpp=.o)
EXEC=test
FLAGS= -w
LINKS=

%.o: %.cpp
    $(CC) -c $*.cpp -o $*.o

$(EXEC): $(OBJS)
    $(CC) $(OBJS) $(FLAGS) $(LINKS) -o $(EXEC)

all: $(EXEC)

exe: 
    $(shell ./$(EXEC))

run: all exe

clean: 
    rm -rf *.o $(EXEC)

This is a combination of taking basic make tutorials and reading Makefiles in github

main.cpp:

#include <iostream>

using namespace std;

int main()
{
    cout << "This is a test!" << endl;

    return 0;
}

Pretty Basic, but will be extending it to help learn to use and extend my Makefile. Now I can see the program compiles and runs, but I get the error after the run.

I searched for Make error 127 and that seems to output that error for many things, but I did not see a definition for the error, or a similar issue to mine.

Понравилась статья? Поделить с друзьями:
  • Maine win64 shipping exe системная ошибка grounded
  • Make maintenance ошибка на ибп
  • Man ошибка 3099
  • Maine f444c6a7 ubisoft connect ошибка
  • Man ошибка 3048