我正在尝试在 Eclipse 中交叉编译一些项目,但我遇到了一个让我发疯的错误。它必须与包含和库标题一起,在图片中可以看到项目树。 图片
问题是我不明白为什么我使用的路径对于编译是错误的,有什么建议吗?
提前致谢,
这是包含给出错误的 TestUtils.cpp
#include "TestUtils.h"
#include <ibrdtn-0.8.0/utils/Utils.h> //sucks
CPPUNIT_TEST_SUITE_REGISTRATION (TestUtils);
void TestUtils::setUp()
{
}
void TestUtils::tearDown()
{
}
void TestUtils::tokenizeTest()
{
using namespace dtn::utils;
CPPUNIT_ASSERT(Utils::tokenize(":", "").empty());
CPPUNIT_ASSERT(Utils::tokenize(":", "::").empty());
CPPUNIT_ASSERT_EQUAL((int)Utils::tokenize(":", ":a:test::", 2).size(), 2);
CPPUNIT_ASSERT_EQUAL((int)Utils::tokenize(":", ":a:test::b::", 2).size(), 3);
//TODO how should the added string in the last item look like? "b::" or ":b::" or "::b::"
CPPUNIT_ASSERT(Utils::tokenize(":", ":a:test::b::", 2)[2] == "b::");
CPPUNIT_ASSERT_EQUAL((int)Utils::tokenize(":", ": :", 1).size(), 1);
CPPUNIT_ASSERT_EQUAL((int)Utils::tokenize(":", ": :t e s t: ").size(), 3);
}
错误是 /tests/utils/TestUtils.cpp:10:38: warning: ibrdtn-0.8.0/utils/Utils.h: No such file or directory
而似乎不存在的Utils.h就是这个
#ifndef UTILS_H_
#define UTILS_H_
#include "ibrdtn/data/Bundle.h"
#include "ibrdtn/data/CustodySignalBlock.h"
#include "ibrdtn/data/StatusReportBlock.h"
#include "ibrdtn/data/PayloadBlock.h"
namespace dtn
{
namespace utils
{
class Utils
{
public:
static void rtrim(std::string &str);
static void ltrim(std::string &str);
static void trim(std::string &str);
static vector<string> tokenize(std::string token, std::string data, size_t max = std::string::npos);
static double distance(double lat1, double lon1, double lat2, double lon2);
static void encapsule(dtn::data::Bundle &capsule, const std::list<dtn::data::Bundle> &bundles);
static void decapsule(const dtn::data::Bundle &capsule, std::list<dtn::data::Bundle> &bundles);
private:
static void encapsule(ibrcommon::BLOB::Reference &ref, const std::list<dtn::data::Bundle> &bundles);
static double toRad(double value);
static const double pi;
};
}
}
#endif /*UTILS_H_*/