[英]g++, Xerces 3.1, “memcpy was not declared in this scope”
在此项目的makefile中,我指定3个位置供编译器查找#includes。
INCLUDES=-I. -I/home/kelly/xerces/xerces-c-3.1.1/src -I/home/kelly/Utilities_New
当我使用注释中的命令行编译以下示例代码时:
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <xercesc/util/XMLString.hpp>
using namespace std;
/*
g++ -I. -I/home/kelly/xerces/xerces-c-3.1.1/src -I/home/kelly/Utilities_New test.cpp
*/
int main(int argc, char* argv[])
{
cout << "this works" << endl;
}
In file included from /home/kelly/Utilities_New/string.h:5:0,
from /home/kelly/xerces/xerces-c-3.1.1/src/xercesc/framework/XMLBuffer.hpp:28,
from /home/kelly/xerces/xerces-c-3.1.1/src/xercesc/util/XMLString.hpp:26,
from test.cpp:7:
/home/kelly/Utilities_New/defs.h:26:21: fatal error: windows.h: No such file or directory
compilation terminated.
显然,编译器已决定,当处理Xerces #includes并在Utilities_New目录中找到string.h时,编译器已找到所需的内容并在那里停止。
这另一个string.h是由另一个程序员编写的,而我正在尝试使用他的库。
我认为应该首先搜索标准位置。 我在这里迷路了。 我可能会错过对大家都非常明显的东西。
另外,关于#include文件周围是否有<>与“”以及应该在哪里查看的编译器,是否存在某些规则?
#include "blah"
与#include <blah>
相同,除非在与尝试包含blah
的文件相同的目录中找到blah
。 (并且除非您使用稀有且特定-iquote
gcc的-iquote
选项)。 有关更多信息,请参见此处 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.