fix: fix error compile and run on Linux
This commit is contained in:
parent
71dbaa1812
commit
c3afba04c1
@ -4,8 +4,8 @@ project(msync LANGUAGES CXX)
|
|||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
list(APPEND CMAKE_PREFIX_PATH "D:/library/wxWidgets/lib/cmake")
|
list(APPEND CMAKE_PREFIX_PATH "D:/library/wxWidgets")
|
||||||
|
list(APPEND CMAKE_PREFIX_PATH "/home/lebo/library/wxWidgets")
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options(/source-charset:utf-8)
|
add_compile_options(/source-charset:utf-8)
|
||||||
endif()
|
endif()
|
||||||
|
10
main.cpp
10
main.cpp
@ -58,10 +58,10 @@ bool parse_xml(const wxString& filepath, const wxString& name,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!find) {
|
if (!find) {
|
||||||
wxLogMessage("未找到%s的配置。", name);
|
wxLogMessage(wxT("未找到%s的配置。"), name);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
wxLogMessage("找到%s的配置。", name);
|
wxLogMessage(wxT("找到%s的配置。"), name);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -95,8 +95,6 @@ wxString get_cmd(Configure& config, bool to_cur)
|
|||||||
cmd_str.append(cmd);
|
cmd_str.append(cmd);
|
||||||
#else
|
#else
|
||||||
cmd_str.append("rsync ");
|
cmd_str.append("rsync ");
|
||||||
dest_str = work_path + config.name;
|
|
||||||
source_str = config.work_dir + config.name;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cmd_str.append("-av");
|
cmd_str.append("-av");
|
||||||
@ -163,11 +161,11 @@ int main(int argc, char* argv[])
|
|||||||
wxArrayString output;
|
wxArrayString output;
|
||||||
// 使用 wxExecute 执行命令
|
// 使用 wxExecute 执行命令
|
||||||
long result = wxExecute(command, output, wxEXEC_SYNC);
|
long result = wxExecute(command, output, wxEXEC_SYNC);
|
||||||
wxLogMessage("命令执行结果:%d", result);
|
wxLogMessage(wxT("命令执行结果:%ld"), result);
|
||||||
wxString out_str;
|
wxString out_str;
|
||||||
for (const auto& data : output) {
|
for (const auto& data : output) {
|
||||||
out_str.append(data + "\n");
|
out_str.append(data + "\n");
|
||||||
}
|
}
|
||||||
wxLogMessage("命令输出:%s", out_str);
|
wxLogMessage(wxT("命令输出:\n%s\n"), out_str);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user