I have installed tdlib from disto repo and trying to build my app:
$ go build cmd/app.go
# github.com/Arman92/go-tdlib
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/11/../../../../lib64/libtdutils.a(misc.cpp.o): undefined reference to symbol '_ZNSt6localeD1Ev@@GLIBCXX_3.4'
/usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
But following works fine:
$ export CGO_LDFLAGS="-lstdc++"
$ go build cmd/app.go
I have installed tdlib from disto repo and trying to build my app:
But following works fine:
-lstdc++
is missing there https://github.com/Arman92/go-tdlib/blob/2454be49c3413c5529a292e3958305936d4ba490/tdlib.go#L6And example from README isn't working also. Try
go build
with-x
flag and you will see that-lstdc++
will not be added.