Giter Site home page Giter Site logo

Comments (9)

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024 1

@Nhoya okay, thanks, seems like I found the problem. It comes with tdlib update v1.1. Trying to fix it now.

from go-tdjson.

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024

@Nhoya seems like my presets for cgo don't work with your configuration. Can you show go env output?

Also you can try to add this line:
//#cgo CFLAGS: -I/usr/local/include

To get it:

package tdjson

//#cgo CFLAGS: -I/usr/local/include
//#cgo LDFLAGS: -ltdjson
//#include <stdlib.h>

If it help you, I will push fix.

from go-tdjson.

Nhoya avatar Nhoya commented on June 9, 2024

go env

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/zeta/.go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build452554512=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"

Adding //#cgo CFLAGS: -I/usr/local/include and rebuilding still:

In file included from ./tdjson.go:7:0:
/usr/local/include/td/telegram/td_log.h:61:1: error: unknown type name 'using'; did you mean 'uint'?
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
 ^~~~~
 uint
/usr/local/include/td/telegram/td_log.h:61:41: error: expected expression before 'void'
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
                                         ^~~~
/usr/local/include/td/telegram/td_log.h:72:52: error: expected declaration specifiers or '...' before 'td_log_fatal_error_callback_ptr'
 TDJSON_EXPORT void td_set_log_fatal_error_callback(td_log_fatal_error_callback_ptr callback);

from go-tdjson.

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024

@Nhoya does this directory even exists? /usr/local/include/td
Maybe you use some special distr. You should set here path to code.

from go-tdjson.

Nhoya avatar Nhoya commented on June 9, 2024

pwd

/usr/local/include/td

ls -lah

drwxr-xr-x 4 root root 4,0K 2 feb 12.24 .
drwxr-xr-x 3 root root 4,0K 2 feb 12.24 ..
drwxr-xr-x 2 root root 4,0K 2 feb 12.24 telegram
drwxr-xr-x 2 root root 4,0K 2 feb 12.24 tl

I'm on archlinux

from go-tdjson.

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024

It's TDLib problem. I opened issue (tdlib/td#29), hope they will fix it soon.

from go-tdjson.

Nhoya avatar Nhoya commented on June 9, 2024

Well i tried with the newer version of tdlib but still

github.com/L11R/go-tdjson
# github.com/L11R/go-tdjson
In file included from ../../../.go/src/github.com/L11R/go-tdjson/tdjson.go:6:0:
./td/telegram/td_log.h:61:1: error: unknown type name 'using'; did you mean 'uint'?
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
 ^~~~~
 uint
./td/telegram/td_log.h:61:41: error: expected expression before 'void'
 using td_log_fatal_error_callback_ptr = void (*)(const char *error_message);
                                         ^~~~
./td/telegram/td_log.h:72:52: error: expected declaration specifiers or '...' before 'td_log_fatal_error_callback_ptr'
 TDJSON_EXPORT void td_set_log_fatal_error_callback(td_log_fatal_error_callback_ptr callback);
                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

from go-tdjson.

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024

@Nhoya as you can see here: https://github.com/tdlib/td/blob/master/td/telegram/td_log.h#L61
There is no any keyword using. You just didn't update tdlib.

from go-tdjson.

savely-krasovsky avatar savely-krasovsky commented on June 9, 2024

I test it myself. All working as should. So I close it.
image

from go-tdjson.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.