2013-01-18 2 views
0

이클립스에서 일부 porject를 크로스 컴파일하려고하는데 오류가 발생하여 미쳐 버리게됩니다. 흠도 및 라이브러리 헤더가 있어야하며, 그림에서는 프로젝트 트리로 볼 수 있습니다. PICTURE이클립스에서 라이브러리 헤더 포함 오류가 발생했습니다.

문제점은 내가 사용하는 경로가 컴파일에 대한 잘못된 점인 이유를 이해할 수 없다는 것입니다. 사전에

감사합니다,

가 포함이 오류이 /tests/utils/TestUtils.cpp:10:38입니다 오류

#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); 
} 

에게 TestUtils.cpp 준다 : 경고 : ibrdtn-0.8.0/유틸/Utils.h : 존재하지 않는 것 같습니다 해당 파일이나 디렉토리

그리고 Utils.h이

입니다 그것은 당신이 이클립스에 의해 참조되는 포함의 일부가 아니므로 691,363,210
#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_*/ 

답변

0
  • 첫 번째 문제는, 다음은 인용 ""하지 <>에 둘러싸여해야한다.

  • 둘째, 포함 경로가 잘못되었습니다. 계정이없는 ibrtn 하위 폴더 이 있습니다. 그래서, 대신 주요 상위 폴더를 필요없이 포함 경로는 #include "ibrdtn/utils/Utils.h"

수정이 두 항목을해야합니다 그리고 당신은 사업에 있어야합니다.

+0

두 번째 요점이 표시되지 않습니다. 포함 경로는 어디에 있습니까? – ndarkness

+0

당신은'ibrdtn-0.8.0/utils/Utils.h'을 가지고 있습니다. 당신의 사진에서'ibrdtn-0.8.0/ibrdtn/utils/Utils.h'이어야합니다. 당신이 보여주지 않는 것이 없다면. Utils.h에서 올바른 경로 (예 :'ibrdtn' 디렉토리)를 가지고있는 디렉토리를 볼 수도 있습니다. –

+0

이미 해봤지만 여전히 같은 문제가 있습니다.'code error : .../ibrdtn- 0.82/tests/utils/TestUtils.cpp : 10 : 45 : error : ibrdtn-0.8.0/ibrdtn/utils/Utils.h : 파일이나 디렉토리가 없습니다. ' – ndarkness

관련 문제