我有这个代码,在我的笔记本电脑上编译,在亚马逊上它不是。它找不到问题TimeStamp.h
(用于测量代码的执行时间)和Options.h
(用于解析输入参数)文件。代码是用C ++编写的,但文件实际上是带有C扩展名的code.c
。我正在尝试使用g++ -o code code.c
运行它。我只给你一部分你可能尝试运行的代码。例如,类型Option和Options(使用方法isSet)很有意义,也许他们可以帮助在网上找到这个类,虽然目前没有运气。 您知道从哪里获取这些文件吗?
#include <iostream>
#include <sstream>
#include <string>
//#include <stdio.h>
#include "TimeStamp.h"
#include "Options.h"
static Option opts[] = {
//Option("binary", 'b', "Input File is in Binary Format"),
};
using namespace std;
int main(int argc, char * argv[]) {
Options options(argc, argv, opts, sizeof(opts) / sizeof(opts[0]));
if (options.isSet("help") or not options.isSet("file")) {
options.printHelp(std::cout, "(<options>)");
exit(-1);
}
if (options.isSet("log"))
cout << "# " << options << "\n#" << endl;
TimeStamp timeBegin;
std::string fileName = options.optValue("file");
...
}
答案 0 :(得分:2)
如果你在你的g ++命令中添加-M,它会告诉你每个包含来自哪里。
即g++ -o code code.c -M