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

[TD-3160] <fix>: fix c demo program compile issue.
This commit is contained in:
Shuduo Sang 2021-03-03 21:02:47 +08:00 committed by GitHub
commit 19a61df6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 1 additions and 27 deletions

View File

@ -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) {

View File

@ -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);

View File

@ -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)*/);

View File

@ -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)

View File

@ -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));

View File

@ -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]);

View File

@ -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));