我已经调试了这一点,我知道这个问题,我只是不知道如何解决它.
现在我正在使用:
file.open(logFile.c_str(), std::ios::out | std::ios::app);
Run Code Online (Sandbox Code Playgroud)
只要我注释掉下面标记的行,logFile变量就可以正常工作:
time_t rawtime;
struct tm * timeinfo;
time (&rawtime);
timeinfo = localtime (&rawtime);
logFile = "bin/";
if(_DEBUG) { logFile += "Debug/"; }
else { logFile += "Release/"; }
logFile += fileName;
if(_DEBUG) { logFile += "Debug-"; }
else { logFile += "Release-"; }
logFile += asctime(timeinfo); // Works fine with this line commented.
logFile += ".log";
Run Code Online (Sandbox Code Playgroud)
那么如何才能让这条线路正常工作呢?
| 归档时间: |
|
| 查看次数: |
107 次 |
| 最近记录: |