Closed 99702 closed 1 year ago
Hi @99702 - thanks for reporting a bug. I cannot reproduce the problem on a fresh Fedora 38 installation using the following commands:
sudo dnf install git ccache file-devel file-libs gperf readline-devel golang sqlite-devel file-devel openssl-devel zlib-devel cmake make automake gcc gcc-c++
git clone https://github.com/d99kris/nchat && cd nchat
./make.sh build && ./make.sh install
Can I check what output you get if running the following?
file /usr/local/bin/../lib/libwmchat.so
ldd /usr/local/bin/../lib/libwmchat.so
file $(which nchat)
Another thing you could try is to disable dynamic loading of protocol plugins (such as WhatsApp) by editing CMakeLists.txt
and changing line 53 from
option(HAS_DYNAMICLOAD "Dynamic Load" ON)
to
option(HAS_DYNAMICLOAD "Dynamic Load" OFF)
and then rebuild and see if it helps.
Hello, Thanks for helping.I installed libraries sudo dnf install git ccache file-devel file-libs gperf readline-devel golang sqlite-devel file-devel openssl-devel zlib-devel cmake make automake gcc gcc-c++
and tried to use option(HAS_DYNAMICLOAD "Dynamic Load" OFF)
which crashed when compiling giving following output and didnt worked..
...
/usr/bin/ld: lib/libwmchat.so: undefined reference to `image_1color.Gray..d'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `net_1http.Client..p'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `runtime.mapaccess1__faststr'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `internal_1bytealg..types'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `runtime.mapaccess2'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `path..types'
/usr/bin/ld: lib/libwmchat.so: undefined reference to `sort..types'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/nchat.dir/build.make:487: bin/nchat] Error 1
make[1]: *** [CMakeFiles/Makefile2:487: CMakeFiles/nchat.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
build failed, exiting.
Here is my output of following
file /usr/local/bin/../lib/libwmchat.so
/usr/local/bin/../lib/libwmchat.so: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=d9d9a0c57e35829a2dc041242542093b9ab74cd4, with debug_info, not stripped
ldd /usr/local/bin/../lib/libwmchat.so
linux-vdso.so.1 (0x00007ffe9b066000)
libncutil.so => /usr/local/lib/libncutil.so (0x00007f8f7cf8d000)
libmagic.so.1 => /lib64/libmagic.so.1 (0x00007f8f7cf47000)
libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007f8f7c0b2000)
libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f8f7cf1c000)
libpng16.so.16 => /lib64/libpng16.so.16 (0x00007f8f7c079000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f8f7be00000)
libm.so.6 => /lib64/libm.so.6 (0x00007f8f7bd1f000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f8f7cef6000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8f7bb41000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8f7d08a000)
libz.so.1 => /lib64/libz.so.1 (0x00007f8f7c05f000)
libXau.so.6 => /lib64/libXau.so.6 (0x00007f8f7c059000)
file $(which nchat)
/usr/local/bin/nchat: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5eaabc9f6716ebb224f71f5a9b673996953cf960, for GNU/Linux 3.2.0, with debug_info, not stripped
Hi @99702 - thanks for providing the info! It appears there's some problem with building the Go interfacing part. Can you please share the output of go version
and also go env
?
go version
: go version go1.18 gccgo (GCC) 13.1.1 20230511 (Red Hat 13.1.1-2) linux/amd64
and go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/kali/.cache/go-build"
GOENV="/home/kali/.config/go/env"
GOEXE=""
GOEXPERIMENT="fieldtrack,regabiwrappers"
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/kali/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/kali/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/libexec/gcc/x86_64-redhat-linux/13"
GOVCS=""
GOVERSION="go1.18 gccgo (GCC) 13.1.1 20230511 (Red Hat 13.1.1-2)"
GCCGO="/usr/bin/gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/kali/Code/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1063314908=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
Thank you, this is very useful information 👍
I can now reproduce the problem on a fresh Fedora 38 system with the following commands:
dnf install gccgo
sudo dnf install git ccache file-devel file-libs gperf readline-devel golang sqlite-devel file-devel openssl-devel zlib-devel cmake make automake gcc gcc-c++
./make.sh build && ./make.sh install
It seems nchat
whatsapp library compiled using gccgo
fails to load / crashes.
You can work around the problem by selecting golang
as your default go
compiler:
sudo update-alternatives --config go
It will present a menu like:
There are 2 programs which provide 'go'.
Selection Command
-----------------------------------------------
*+ 1 /usr/bin/go.gcc
2 /usr/lib/golang/bin/go
Proceed to select the number for golang
/ /usr/lib/golang/bin/go
(in the above menu example it's number 2
).
Before building nchat
again, go to the folder with your local clone and remove any local changes:
git checkout .
and remove all build-generated files:
git clean -ffdx
Then build again:
./make.sh build
As for the actual root cause of the problem I am not sure yet, I might take a look at pinpointing it eventually (or at least have the build script warn if gccgo
is the selected go
compiler), but for now nchat
only supports golang
version of go
.
Support for gccgo
has been added in the above commit, so you may disregard from the workaround mentioned in my previous comment above, and instead get latest nchat
, and it should be able to build / work fine with gccgo
as the default go compiler.
Please let me know if you still encounter any issues.
wow Great, Thank you alot @d99kris . It works now.
Description: I've compiled and try to run
nchat --setup
in fedora. It works fortelegram
while doesn't works for whatsapp option, as soon as i type 2 (whatsapp) option it throws error sayingHere is my log of nchat:
Environment: