假设我有一个如下文件
Mainfile.cpp
#include "stdafx.h"
#include <stdlib.h>
#include "Myfile.h"
#ifdef _MYFILE
#error Myfile.h to be included. Please refer Ream Me at C:\ReadMe
#endif
int _tmain(int argc, _TCHAR* argv[])
{
system("pause");
return 0;
}
Myfile.h
#pragma once
#undef _MYFILE
#define MYFILE
我的目标是提供附加信息(“请参阅....”)以防丢失(路径中未包含/找到 MyFile.h)。
如何使用第三方库(如 Boost)处理此问题?在这种情况下,我无法控制Boost
并且无法处理 _MYFILE: 的定义:那么如何抛出错误?
Pseudo code
#include "boost/boost.h"
#if (boost is not included || directory path is not set || boost .h file not found)
#error: Set boost path and compile again
#endif