'CGO_CFLAGS' is not recognized as an internal or external command, - mingw-w64

I am getting an error while compiling make file using mingw64. I have already installed go in my system
C:\Users\geogi\Downloads\magicard-recover-master\magicard>mingw32-make makefile windows
mingw32-make: Nothing to be done for 'makefile'.
CGO_CFLAGS="-I/include" CGO_LDFLAGS="-L/lib/Windows -Wl,--enable-stdcall-fixup,-rpath=/lib/Windows -lHCNetSDK" GOOS=windows CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ go build -ldflags "-s -w" -o build/Windows/magicard-recover.exe src/magicard-recover.go
'CGO_CFLAGS' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make: *** [Makefile:17: windows] Error 1
error " 'CGO_CFLAGS' is not recognized as an internal or external command "
I tried to install go but still issue not resolved. I have also added go to environment variables.

Related

Mozilla syncstorage-rs installation / make fails under RHEL8

I'm currently trying to install Mozilla syncstorage-rs on a RockyLinux machine, and step by step I could reduce the amount of errors, but now I got stuck. I found in Makefile to execute the following command in case of SSL trouble, so I did so cargo build --features grpcio/openssl
and this is fine, this finally works:
cargo build --features grpcio/openssl
Compiling syncstorage v0.10.2 (/var/www/html/syncstorage-rs)
Finished dev [unoptimized + debuginfo] target(s) in 35.59s
But when I try to now run either make run or make test or anything else, I just get:
= note: /usr/bin/ld: /var/www/html/syncstorage-rs/target/debug/deps/libopenssl-dc6f50ea1194640f.rlib(openssl-dc6f50ea1194640f.openssl.9bacb62b-cgu.1.rcgu.o): undefined reference to symbol 'OPENSSL_cipher_name##OPENSSL_1_1_1'
//usr/lib64/libssl.so.1.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
= help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
error: could not compile `syncstorage` due to previous error
make: *** [Makefile:45: test] Error 101
What am I missing? I thought after building it could be run easily.
So the answer is to use cargo clean before continuing. I don't know why, but there seemed to be some old artifacts even if I hadn't built before. However, after executing cargo clear command, the build openssl runs completely (many lines more than before) and after that, there is one more little step to do:
python3 -m venv venv # creates a virtual environment named "venv"
source venv/bin/activate # enters the virtual environment
python3 -m pip install -r requirements.txt # installs the packages
and finally make run works.
For more details, see https://github.com/mozilla-services/syncstorage-rs/issues/1241
See https://www.youtube.com/watch?v=jdtoyIW4Lec
for a step by step instruction.

CHAINLINK_VERSION' is not recognized

#chainlink/contracts
| Nothing to compile
| No need to generate any newer typings.
Done in 37.75s.
CHAINLINK_VERSION="#22a3c1788eb9bf6d8b099bf8e1a9ee0f6e081eaf" yarn workspace #chainlink/operator-ui build
'CHAINLINK_VERSION' is not recognized as an internal or external command,
operable program or batch file.
make: *** [GNUmakefile:49: operator-ui] Error 1
After using the command make install i got the error above

Run ./configure from bash script fails due "error: cannot compute suffix of object files"

I'm trying to automate some stage of compile/build on Linux RHEL7 host using a bash script, but when i try to use ./configure it fails due to :
configure:3793: error: in `/app/compiling/BUILD_AREA/TEST/SRC/zabbix-4.2.6':
configure:3795: error: cannot compute suffix of object files: cannot compile
using :
CC="gcc"
PATH="/app/app_lib/mysql/bin:/app/app_lib/bin:/app/app_lib/build-1:/app/app_lib:$PATH"
LD_LIBRARY_PATH="/app/app_lib:/app/app_lib/include:/app/app_lib/lib:/app/apache/modules:/app/app_lib/ssl:/app/app_lib/lib/iconv:/app/oracle/product/12.1.0/lib:/app/ap_lib/mysql/lib:$LD_LIBRARY_PATH"
export CC
export PATH
export LD_LIBRARY_PATH
ARG_ZABBIX="--prefix=/app/zabbix --datarootdir=/app/zabbix/share --docdir=/app/zabbix/share/doc/$PKGAPPDIR --enable-agent --enable-ipv6 --enable-java --enable-server --includedir=/app/zabbix/include --libdir=/app/zabbix/lib --mandir=/app/zabbix/share/man/$PKGAPPDIR --with-libcurl=/app/app_lib/bin/curl-config --with-libxml2=/app/app_lib/bin/xml2-config --with-mysql=/app/mysql/bin/mysql_config --with-net-snmp=/app/app_lib/bin/net-snmp-config --with-openipmi=/app/app_lib --with-ssh2=/app/app_lib"
CONFIGURE="configure"
cd /app/compiling/BUILD_AREA/TEST/SRC/zabbix-4.2.6
"./${CONFIGURE}" "${ARG_ZABBIX}" 2>&1
Any help would be really appreciated!
Any help would be really appreciated!
Find the respective config.log (like the one in $(builddir)/gcc) and have a look. Some configure tests might fail as configure is querying availability of host features; the relevant fail is usually recorded at the end of the relevant config.log.
A common cause for this error is that the target Binutils (as, the assembler) cannot be found as configure is trying to find out what suffix to use for object files. Or host as is used where actually the target as (as of --target=) should be used, and the host as throws a syntax error because it is fed with target assembly.
./configure
GCC does not support configuring in the source directory or any of its sub-folders:
"First, we highly recommend that GCC be built into a separate directory from the sources which does not reside within the source tree."

Dockerfile can't find shell script on build [duplicate]

This question already has answers here:
Are shell scripts sensitive to encoding and line endings?
(14 answers)
Closed 3 years ago.
I'm trying to docker build an application that utilizes go. To install go, the dockerfile has the following command (this executes fine, by the way):
RUN wget https://dl.google.com/go/go1.11.linux-amd64.tar.gz \
&& tar -xf go1.11.linux-amd64.tar.gz \
&& mv go /usr/local
The problem arises when script runs shell files within the 'install' subdirectory. Note, output of the following two steps:
Step 9/13 : RUN . install/install-lmdb-linux.sh
---> Running in 0c666807720a
: not found install/install-lmdb-linux.sh:
: not found install/install-lmdb-linux.sh:
-e
Installing LMDB
Cloning into 'lmdb'...
: not found install/install-lmdb-linux.sh:
make: Entering directory '/root/bystro/lmdb/libraries/liblmdb'
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized -c mdb.c
gcc -pthread -O2 -g -W -Wall -Wno-unused-parameter -Wbad-function-cast -Wuninitialized -c midl.c
ar rs liblmdb.a mdb.o midl.o
ar: creating liblmdb.a
This shell script seems to be failing, but somehow recovers (?) and build continues to:
Step 11/13 : RUN . install/install-go-packages.sh
---> Running in 7700bf77c2b1
: not found install/install-go-packages.sh:
-e
Installing go packages (bystro-vcf, stats, snp)
: not found install/install-go-packages.sh:
: not found install/install-go-packages.sh:
: not found install/install-go-packages.sh:
Made /root/go path
: not found install/install-go-packages.sh:
: not found install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
: not found: install/install-go-packages.sh:
The command '/bin/sh -c . install/install-go-packages.sh' returned a non-zero code: 127
This script is the point at which build fails with exit code 127 (command not found). The task of this script is basically just to 'go install' some dependencies for the app.
My Debug:
After messing around with variations of the two RUN functions, I finally decided to log some of the situation: I check to see if the two shell scripts were actually present at runtime, and to see if Go was present at runtime. Both were present.
Step 9/15 : RUN ls install/
---> Running in 0f0ad051b009
export-bystro-libs.sh
export-go-path-linux.sh
install-apt-deps.sh
install-go-linux.sh
install-go-mac.sh
install-go-packages.sh
install-liftover-linux.sh
install-lmdb-linux.sh
install-mac-deps.sh
install-perl-libs.sh
install-perlbrew-linux.sh
install-rpm-deps.sh
update-packages.sh
Step 12/15 : RUN go version
---> Running in b8b9d08ef9c3
go version go1.11 linux/amd64
Also, note, both scripts execute perfectly when I run them manually.
Question:
Why is my build failing? It seems like Docker has the scripts, the tools to execute them, and the proper instruction to do so, so I'm not sure how to approach this.
If you don't want to use absolute path.
There is a command for changing your working directory
WORKDIR /your/directory
Then execute your shell commands using RUN
reference:Change directory command in Docker?

What is the fix for "NMAKE: fatal error u1073"?

I am trying to install apr-1.4.5 in Windows. When I try the following,
nmake Makefile.win PREFIX="c:\Program Files\apr"
I get the following error:
NMAKE: fatal error u1073: Dont know how to make 'Makefile.win'
Does anyone know the reason for this and how to resolve this error?
To specify the name of the makefile you should use /f command line option:
nmake /f Makefile.win PREFIX="c:\Program Files\apr"
Regular nmake parameters are considered to be build targets - and there is no build target called Makefile.win which is what the error message was trying to tell you.

Resources