解决websdk linux编译问题

This commit is contained in:
luoliangyi 2022-06-09 17:51:07 +08:00
parent 3658b0e682
commit a3455fb5c5
2 changed files with 28 additions and 22 deletions

View File

@ -288,6 +288,7 @@
</Compiler>
<Linker>
<Add option="-lpthread" />
<Add option="-ldl" />
</Linker>
<Unit filename="../../../sdk/webservice/HttpHead.cpp" />
<Unit filename="../../../sdk/webservice/HttpHead.h" />
@ -325,6 +326,11 @@
<Unit filename="../../../third_party/json/cJSON.h" />
<Unit filename="../../../third_party/sha1/sha1.cpp" />
<Unit filename="../../../third_party/sha1/sha1.h" />
<Unit filename="../../../third_party/sqlite/sqlite3.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="../../../third_party/sqlite/sqlite3.h" />
<Unit filename="../../../third_party/sqlite/sqlite3ext.h" />
<Unit filename="../../../utility/HGString.cpp" />
<Unit filename="../../../utility/HGString.h" />
<Extensions>

View File

@ -112,8 +112,8 @@ namespace ver_2
assert(0 == ret);
}
std::vector<std::pair<int, std::string>> tables;
std::vector<std::pair<int, std::string> > tables;
char** result = NULL;
int rows, cols;
ret = sqlite3_get_table(m_sqlite, "select * from table_", &result, &rows, &cols, NULL);
@ -234,7 +234,7 @@ namespace ver_2
if ((mask & GlobalConfig::imageTiffJpegQualityMask) && (cfg.imageTiffJpegQuality < 0 || cfg.imageTiffJpegQuality > 100))
return -1;
HGBase_EnterLock(m_lock);
HGBase_EnterLock(m_lock);
if (mask & GlobalConfig::fileSavePathMask)
{
std::string fileSavePath = cfg.fileSavePath;
@ -248,7 +248,7 @@ namespace ver_2
{
m_globalCfg.fileNamePrefix = cfg.fileNamePrefix;
SetCfgStringValue("global", "fileNamePrefix", m_globalCfg.fileNamePrefix);
}
}
if (mask & GlobalConfig::fileNameModeMask)
{
m_globalCfg.fileNameMode = cfg.fileNameMode;
@ -1049,7 +1049,7 @@ namespace ver_2
if (NULL == m_sqlite)
return -1;
std::vector<std::pair<int, std::string>> tables;
std::vector<std::pair<int, std::string> > tables;
char** result = NULL;
int rows, cols;
@ -1412,7 +1412,7 @@ namespace ver_2
return -1;
}
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1469,14 +1469,14 @@ namespace ver_2
{
if (tables[i].second >= insertPos)
{
sprintf(sql, "update 'table_%s' set idx = '%d' where id = '%d'",
sprintf(sql, "update 'table_%s' set idx = '%d' where id = '%d'",
m_currBatchId.c_str(), tables[i].second + 1, tables[i].first);
ret = sqlite3_exec(m_sqlite, sql, NULL, NULL, NULL);
assert(0 == ret);
}
}
sprintf(sql, "insert into 'table_%s' (idx, format, tag, image, thumb) values ('%d', '%s', '%s', ?, ?)", m_currBatchId.c_str(),
sprintf(sql, "insert into 'table_%s' (idx, format, tag, image, thumb) values ('%d', '%s', '%s', ?, ?)", m_currBatchId.c_str(),
insertPos, imgFormat.c_str(), imageTag.c_str());
sqlite3_stmt* stmt = NULL;
ret = sqlite3_prepare(m_sqlite, sql, -1, &stmt, NULL);
@ -1516,7 +1516,7 @@ namespace ver_2
return -1;
}
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1602,12 +1602,12 @@ namespace ver_2
int ManagerV2::ModifyImageTag(const std::vector<int>& imageIndexList, const std::vector<std::string>& imageTagList, std::string& errInfo)
{
errInfo = "错误";
if (NULL == m_sqlite || imageIndexList.empty() || imageTagList.empty()
|| imageIndexList.size() != imageTagList.size())
return -1;
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1662,7 +1662,7 @@ namespace ver_2
for (int i = 0; i < (int)imageIndexList.size(); ++i)
{
sprintf(sql, "update 'table_%s' set tag = '%s' where idx = '%d'", m_currBatchId.c_str(),
sprintf(sql, "update 'table_%s' set tag = '%s' where idx = '%d'", m_currBatchId.c_str(),
imageTagList[i].c_str(), imageIndexList[i]);
ret = sqlite3_exec(m_sqlite, sql, NULL, NULL, NULL);
assert(0 == ret);
@ -1679,7 +1679,7 @@ namespace ver_2
if (NULL == m_sqlite || imageIndexList.empty())
return -1;
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1760,7 +1760,7 @@ namespace ver_2
{
if (value > 0)
{
sprintf(sql, "update 'table_%s' set idx = '%d' where id = '%d'",
sprintf(sql, "update 'table_%s' set idx = '%d' where id = '%d'",
m_currBatchId.c_str(), tables[i].second - value, tables[i].first);
ret = sqlite3_exec(m_sqlite, sql, NULL, NULL, NULL);
assert(0 == ret);
@ -1809,7 +1809,7 @@ namespace ver_2
return -1;
}
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1856,7 +1856,7 @@ namespace ver_2
return -1;
}
sprintf(sql, "update 'table_%s' set format = '%s', image = ?, thumb = ? where idx = '%d'",
sprintf(sql, "update 'table_%s' set format = '%s', image = ?, thumb = ? where idx = '%d'",
m_currBatchId.c_str(), imgFormat.c_str(), imageIndex);
sqlite3_stmt* stmt = NULL;
ret = sqlite3_prepare(m_sqlite, sql, -1, &stmt, NULL);
@ -1896,7 +1896,7 @@ namespace ver_2
return -1;
}
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -1972,7 +1972,7 @@ namespace ver_2
if ("pos" != mode && "index" != mode)
return -1;
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -2064,7 +2064,7 @@ namespace ver_2
}
else
{
std::vector<std::pair<int, int>> prs;
std::vector<std::pair<int, int> > prs;
for (int i = 0; i < (int)imageIndexList.size(); ++i)
{
int oldIndex = -1;
@ -2121,7 +2121,7 @@ namespace ver_2
if (NULL == m_sqlite)
return -1;
std::vector<std::pair<int, int>> tables;
std::vector<std::pair<int, int> > tables;
char** result = NULL;
char sql[256];
@ -2151,7 +2151,7 @@ namespace ver_2
sqlite3_free_table(result);
std::sort(tables.begin(), tables.end(), BatchTableSort);
std::list<std::pair<int, int>> prs1, prs2;
std::list<std::pair<int, int> > prs1, prs2;
for (int i = 0; i < (int)tables.size(); ++i)
{
std::pair<int, int> pr = tables[i];
@ -2162,7 +2162,7 @@ namespace ver_2
}
tables.clear();
std::list<std::pair<int, int>>::const_iterator iter;
std::list<std::pair<int, int> >::const_iterator iter;
for (iter = prs1.begin(); iter != prs1.end(); ++iter)
tables.push_back(*iter);
for (iter = prs2.begin(); iter != prs2.end(); ++iter)