diff --git a/deps/libcurl/lib/win64/libcurl_a.lib b/deps/libcurl/lib/win64/libcurl_a.lib new file mode 100644 index 0000000000000000000000000000000000000000..69e9fe0a57ef49b3b95cbd369fed95ef885efb95 Binary files /dev/null and b/deps/libcurl/lib/win64/libcurl_a.lib differ diff --git a/src/kit/taosdemo/CMakeLists.txt b/src/kit/taosdemo/CMakeLists.txt index 1f755d6c24abda3ba1ed581b736503df85a3dd71..7e85ec6dacc7bb33a1599d28e44d4f42bcb0a9bf 100644 --- a/src/kit/taosdemo/CMakeLists.txt +++ b/src/kit/taosdemo/CMakeLists.txt @@ -25,7 +25,13 @@ IF (TD_LINUX) ELSEIF (TD_WINDOWS) AUX_SOURCE_DIRECTORY(. SRC) ADD_EXECUTABLE(taosdemo ${SRC}) - TARGET_LINK_LIBRARIES(taosdemo taos_static cJson) + SET_SOURCE_FILES_PROPERTIES(./taosdemo.c PROPERTIES COMPILE_FLAGS -w) + find_library(LIBCURL_A libcurl_a HINTS ${TD_COMMUNITY_DIR}/deps/libcurl/lib/win64) + IF (TD_SOMODE_STATIC) + TARGET_LINK_LIBRARIES(taosdemo taos_static cJson ${LIBCURL_A}) + ELSE () + TARGET_LINK_LIBRARIES(taosdemo taos cJson ${LIBCURL_A}) + ENDIF () ELSEIF (TD_DARWIN) # missing a few dependencies, such as # AUX_SOURCE_DIRECTORY(. SRC) diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 74c6b9ad01318013cf1f92afb7df95fb78a5c005..8c972337723a6603a6818520d4d8d800ff74e49f 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -27,7 +27,6 @@ #ifdef LINUX #include "os.h" - #include "cJSON.h" #include #include #include @@ -51,12 +50,14 @@ #include #include "os.h" - #pragma comment ( lib, "libcurl.lib" ) + #pragma comment ( lib, "libcurl_a.lib" ) #pragma comment ( lib, "ws2_32.lib" ) #pragma comment ( lib, "winmm.lib" ) #pragma comment ( lib, "wldap32.lib" ) #endif +#include "cJSON.h" + #include "taos.h" #include "tutil.h" @@ -2238,7 +2239,7 @@ int readTagFromCsvFileToMem(SSuperTable * superTblInfo) { return -1; } - while ((readLen = getline(&line, &n, fp)) != -1) { + while ((readLen = tgetline(&line, &n, fp)) != -1) { if (('\r' == line[readLen - 1]) || ('\n' == line[readLen - 1])) { line[--readLen] = 0; } @@ -2292,7 +2293,7 @@ int readSampleFromCsvFileToMem(FILE *fp, SSuperTable* superTblInfo, char* sample memset(sampleBuf, 0, MAX_SAMPLES_ONCE_FROM_FILE* superTblInfo->lenOfOneRow); while (1) { - readLen = getline(&line, &n, fp); + readLen = tgetline(&line, &n, fp); if (-1 == readLen) { if(0 != fseek(fp, 0, SEEK_SET)) { printf("Failed to fseek file: %s, reason:%s\n", superTblInfo->sampleFile, strerror(errno)); @@ -4350,7 +4351,7 @@ int insertTestProcess() { fprintf(g_fpOfInsertResult, "Spent %.4f seconds to create %d tables with %d thread(s)\n\n", end - start, g_totalChildTables, g_Dbs.threadCount); } - usleep(1000*1000); + taosMsleep(1000); // create sub threads for inserting data //start = getCurrentTime();