TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

C client error: error while loading shared libraries: libtaos.so.1

Open forestery opened this issue 7 years ago • 3 comments

os: ubuntu 16.04 version: 1.6.0.0 via deb downloaded from www.taosdata.com source code: https://www.taosdata.com/blog/2019/07/10/%e4%bd%bf%e7%94%a8tdengine%e5%bf%ab%e9%80%9f%e6%90%ad%e5%bb%ba%e8%bd%a6%e8%81%94%e7%bd%91%e5%b9%b3%e5%8f%b0/

#include <stdio.h> 
#include <stdlib.h>
#include <string.h> 
#include <unistd.h> 
#include "time.h"
#include "taos.h"
int main(int argc, char *argv[]) {
   taos_init();
 
   TAOS *taos = taos_connect("127.0.0.1", "root", "taosdata", NULL, 0);
   if (taos == NULL) {
     printf("failed to connect to server, reason:%s\n", taos_errstr(taos));
     exit(1);
   }
 
   if (taos_query(taos, "create database db cache 8192 ablocks 2 tblocks 1000 tables 10000") != 0) {
     printf("failed to create database, reason:%s\n", taos_errstr(taos));
     exit(1);
   }
 
   taos_query(taos, "use db");
 
   char sql[65000] = "create table vehicles(ts timestamp, longitude bigint, latitude bigint, altitude int, direction int, velocity int) tags(card int, model binary(10))";
   if (taos_query(taos, sql) != 0) {
     printf("failed to create stable, reason:%s\n", taos_errstr(taos));
     exit(1);
   }
 
   int begin = time(NULL);
   for (int table = 0; table < 100000; ++table) {
     sprintf(sql, "create table v%d using vehicles tags(%d, 't%d')", table, table, table);
     if (taos_query(taos, sql) != 0) {
       printf("failed to create table t%d, reason:%s\n", table, taos_errstr(taos));
       exit(1);
     }
 
     for (int loop = 0; loop < 44; loop++) {   
       int len = sprintf(sql, "insert into v%d values", table);   
       for (int row = 0; row < 1000; row++) {     
         len += sprintf(sql + len, "(%ld,%d,%d,%d,%d,%d)", 1561910400000L + 60000L * (row + loop * 1000L), row, row, row, row, row);   
       }   
       if (taos_query(taos, sql) != 0) {     
         printf("failed to insert table t%d, reason:%s\n", table, taos_errstr(taos));   
       } 
     }
   }
   int end = time(NULL);
     printf("insert finished, time spend %d seconds", end - begin);
   }
}

error:

./test: error while loading shared libraries: libtaos.so.1: cannot open shared object file: No such file or directory

fix way: sudo ln -s /usr/local/taos/driver/libtaos.so ./libtaos.so.1

forestery avatar Jul 15 '19 07:07 forestery

您是怎么编译通过的?没遇到这个问题吗: CMake Error at src/client/CMakeLists.txt:30 (SET_TARGET_PROPERTIES): SET_TARGET_PROPERTIES called with incorrect number of arguments.

maymay1982 avatar Jul 15 '19 09:07 maymay1982

您是怎么编译通过的?没遇到这个问题吗: CMake Error at src/client/CMakeLists.txt:30 (SET_TARGET_PROPERTIES): SET_TARGET_PROPERTIES called with incorrect number of arguments. 你好,请问这个问题解决了吗?

zhangchi0923 avatar Jul 17 '19 12:07 zhangchi0923

@forestery 我们安装包中的链接有部分问题,最近刚刚修复了,您可以重新下载,卸载掉老的后重新安装体验下。如果还有问题,请继续留言询问

hzcheng avatar Jul 19 '19 09:07 hzcheng