Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译时提示无法找到taos.h #231

Open
Limbooh opened this issue Jan 2, 2024 · 6 comments
Open

编译时提示无法找到taos.h #231

Limbooh opened this issue Jan 2, 2024 · 6 comments

Comments

@Limbooh
Copy link

Limbooh commented Jan 2, 2024

root/go/pkg/mod/github.com/taosdata/driver-go/[email protected]/wrapper/asynccb.go:7:10: fatal error: taos.h: No such file or directory
#include <taos.h>
^~~~~~~~
compilation terminated.

@Limbooh
Copy link
Author

Limbooh commented Jan 2, 2024

编译操作系统 linux centos 8 4.18.0-240.10.1.el8_3.x86_64

@litongjava
Copy link

我在运行时也遇到了这个错误

package tdengine

import (
    "database/sql"
    "fmt"
    _ "github.com/taosdata/driver-go/v3/taosSql"
    "log"
    "testing"
)

func TestConnectToTdEngine(t *testing.T) {
    log.Println("start")
    var taosUri = "root:taosdata@ws(192.168.3.9:6041)/"
    taos, err := sql.Open("taosWS", taosUri)
    if err != nil {
        fmt.Println("failed to connect TDengine, err:", err)
        return
    }
    log.Println("taos:", taos)
}

GOROOT=D:\dev_program\go #gosetup
GOPATH=D:\dev_gopath #gosetup
D:\dev_program\go\bin\go.exe test -c -o C:\Users\Administrator\AppData\Local\JetBrains\GoLand2023.1\tmp\GoLand\___TestConnectToTdEngine_in_go_emqx_to_tdengine_tdengine.test.exe go-emqx-to-tdengine/tdengine #gosetup
# github.com/taosdata/driver-go/v3/wrapper
D:\dev_gopath\pkg\mod\github.com\taosdata\driver-go\[email protected]\wrapper\asynccb.go:7:10: fatal error: taos.h: No such file or directory
    7 | #include <taos.h>
      |          ^~~~~~~~
compilation terminated.

Compilation finished with exit code 1

@wirelessmcu
Copy link

macos same issue:

github.com/taosdata/driver-go/v3/wrapper

vendor/github.com/taosdata/driver-go/v3/wrapper/asynccb.go:7:10: fatal error: 'taos.h' file not found
#include <taos.h>
^~~~~~~~
1 error generated.

@Limbooh
Copy link
Author

Limbooh commented Feb 2, 2024

因为找不到taos.h头文件,所以会报这个错,安装taos客户端相关的头文件会引入系统lib目录,然后就可以了

@qmdx
Copy link

qmdx commented Mar 5, 2024

taos 这真不是一般的难用,一个 client 搞的一塌糊涂

@SkywardSky
Copy link

因为找不到taos.h头文件,所以会报这个错,安装taos客户端相关的头文件会引入系统lib目录,然后就可以了

macos 安装了taos客户端后还是不行,依然找不到taos.h头文件,通过find找到taos.h是存放到了:/usr/local/include/taos.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants