EasyNTS has a function that supports pulling rtsp and retweeting rtmp. This function requires the use of cgo, so a corresponding cross-compilation environment needs to be built. The corresponding cross-compilation build steps are as follows:
arm-hisiv500-linux.tgz: Install the cross compiler to HOST for
decompression and automatic installation
tar -xf arm-hisiv500-linux.tgz
cd arm-hisiv500-linux
TOP_DIR in the arm-hisiv500-linux.install script is the location where the toolchain is installed, which can be modified, and generally the default is sufficient
chmod +x arm-hisiv500-linux.install
sudo ./arm-hisiv500-linux.install
Configure the toolchain to PATH
Toolchain configuration path by default:
export PATH=$PATH:/opt/hisi-linux/x86-arm/arm-hisiv500-linux/target/bin
start testing:
arm-hisiv500-linux-gcc --version
arm-hisiv500-linux-gcc (Hisilicon_v500_20170922) 4.9.4 20150629 (prerelease)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
If the following appears:
arm-hisiv500-linux-gcc: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
This is because gcc is too old. The solution is as follows:
sudo apt-get install lib32z1 lib32ncurses5 lib32stdc++6 -y
If it is a CentOS7.0 64-bit system, an error will generally be reported
This is caused by installing a 32-bit operating system in a 64-bit system, and it can be resolved by installing the corresponding software.
yum install glibc.i686 libstdc++.so.6 -y
Compile the binary program, and finally run the following command to compile the corresponding program.
CGO_ENABLED=1 CC=arm-hisiv500-linux-gcc GOARCH=arm GOOS=linux go build -ldflags \"-s -w\" -o easyntd