在尝试编译这个项目时,我遇到了 2 个我无法解决的错误。
1>initialization.h(6):错误 C4430:缺少类型说明符 - 假定为 int。注意:C++ 不支持默认整数 1>initialization.h(6):错误 C2146:语法错误:在标识符“diskSpaceNeeded”之前缺少“,”
这是发生错误的文件:
初始化.h
#pragma once
extern bool CheckStorage(const DWORDLONG diskSpaceNeeded);
初始化.cpp
#include "Initialization.h"
#include "../Main/EngineStd.h"
#include <shlobj.h>
#include <direct.h>
//
// CheckStorage
//
bool CheckStorage(const DWORDLONG diskSpaceNeeded)
{
// Check for enough free disk space on the current disk.
int const drive = _getdrive();
struct _diskfree_t diskfree;
_getdiskfree(drive, &diskfree);
unsigned __int64 const neededClusters =
diskSpaceNeeded /(diskfree.sectors_per_cluster*diskfree.bytes_per_sector);
if (diskfree.avail_clusters < neededClusters)
{
// if you get here you don’t have enough disk space!
ENG_ERROR("CheckStorage Failure: Not enough physical storage.");
return false;
}
return true;
}
我认为包含有问题,但我找不到错误发生的位置。