未验证 提交 19a61df6 编写于 作者: sangshuduo's avatar sangshuduo 提交者: GitHub

Merge pull request #5334 from taosdata/hotfix/sangshuduo/TD-3160-fix-c-demo-compile

[TD-3160] <fix>: fix c demo program compile issue.
......@@ -467,7 +467,6 @@ int main(int argc, char *argv[]) {
const char* passwd = "taosdata";
taos_options(TSDB_OPTION_TIMEZONE, "GMT-8");
taos_init();
TAOS* taos = taos_connect(host, user, passwd, "", 0);
if (taos == NULL) {
......
......@@ -99,8 +99,6 @@ int main(int argc, char *argv[])
tableList = (STable *)malloc(size);
memset(tableList, 0, size);
taos_init();
taos = taos_connect(argv[1], "root", "taosdata", NULL, 0);
if (taos == NULL)
taos_error(taos);
......
......@@ -61,11 +61,6 @@ int main(int argc, char *argv[]) {
return 0;
}
// init TAOS
if (taos_init()) {
exit(1);
}
TAOS *taos = taos_connect(argv[1], "root", "taosdata", NULL, 0);
if (taos == NULL) {
printf("failed to connect to server, reason:%s\n", "null taos"/*taos_errstr(taos)*/);
......
......@@ -6,7 +6,7 @@ TARGET=exe
LFLAGS = '-Wl,-rpath,/usr/local/taos/driver/' -ltaos -lpthread -lm -lrt
CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion \
-Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX \
-msse4.2 -Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99
-Wno-unused-function -D_M_X64 -I/usr/local/taos/include -std=gnu99
all: $(TARGET)
......
......@@ -22,12 +22,6 @@ int main(int argc, char *argv[])
return 0;
}
// init TAOS
if (taos_init()) {
printf("failed to init taos\n");
exit(1);
}
taos = taos_connect(argv[1], "root", "taosdata", NULL, 0);
if (taos == NULL) {
printf("failed to connect to db, reason:%s\n", taos_errstr(taos));
......
......@@ -54,12 +54,6 @@ int main(int argc, char *argv[])
exit(0);
}
// init TAOS
if (taos_init()) {
printf("failed to init taos\n");
exit(1);
}
strcpy(db_name, argv[2]);
strcpy(tbl_name, argv[3]);
......
......@@ -216,12 +216,6 @@ int main(int argc, char *argv[]) {
}
}
// init TAOS
if (taos_init()) {
printf("failed to init taos\n");
exit(1);
}
TAOS* taos = taos_connect(host, user, passwd, "", 0);
if (taos == NULL) {
printf("failed to connect to db, reason:%s\n", taos_errstr(taos));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册