Commit a55e29dd authored by Zhiping Jiang's avatar Zhiping Jiang

fix vs building errors

parent 9e1c7b05
......@@ -11,9 +11,7 @@
std::string PreferenceManager::storageFilePath = "preference.yaml";
bool PreferenceManager::instantFlush = false;
// an empty yaml document
std::string PreferenceManager::internalDataString = [] ()->std::string {
return cv::FileStorage(storageFilePath, cv::FileStorage::WRITE + cv::FileStorage::MEMORY).releaseAndGetString();
}();
std::string PreferenceManager::internalDataString = cv::FileStorage(storageFilePath, cv::FileStorage::WRITE + cv::FileStorage::MEMORY).releaseAndGetString();
static std::string readFileIntoString(const std::string & filepath) {
......
......@@ -7,6 +7,7 @@
//
#include "ScreenCameraInfo.h"
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <memory>
......@@ -17,7 +18,11 @@
std::string crossPlatform_exec(const char* cmd) {
std::array<char, 128> buffer;
std::string result;
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
#ifdef _WIN32
std::shared_ptr<FILE> pipe(_popen(cmd, "r"), _pclose);
#else
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
#endif
if (!pipe) throw std::runtime_error("popen() failed!");
while (!feof(pipe.get())) {
if (fgets(buffer.data(), 128, pipe.get()) != NULL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment