2015-06-09 84 views
3

我試圖建立一個簡單的項目使用biicode,包括捕獲cpp單元測試庫。現在我已經沒有多餘的聲明,一個簡單的香草項目,看起來像g ++ 5.1.0不是建設項目,鏗鏘顯示未知錯誤

#define CATCH_CONFIG_MAIN 
#include "catch.hpp" 
#include "cbs-algorithm-sort.hpp" 

int returnInt(int n){ return n; }; 

TEST_CASE("Sample test", "[Sample Test]") { 
    REQUIRE(returnInt(1) == 1); 
    REQUIRE(returnInt(2) == 2); 
    REQUIRE(returnInt(3) == 6); 
    REQUIRE(returnInt(10) == 3628800); 
} 
使用g ++ 5.1.0建立時

,顯示下列錯誤和項目從來沒有得到建:

INFO: Processing changes... 
INFO: Saving files from: florianwolters/catch 
Running: "cmake" -G "Unix Makefiles" -Wno-dev ../cmake 
-- The C compiler identification is GNU 5.1.0 
-- The CXX compiler identification is GNU 5.1.0 
-- Check for working C compiler: /usr/bin/cc 
-- Check for working C compiler: /usr/bin/cc -- works 
-- Detecting C compiler ABI info 
-- Detecting C compiler ABI info - done 
-- Detecting C compile features 
-- Detecting C compile features - done 
-- Check for working CXX compiler: /usr/bin/c++ 
-- Check for working CXX compiler: /usr/bin/c++ -- works 
-- Detecting CXX compiler ABI info 
-- Detecting CXX compiler ABI info - done 
-- Detecting CXX compile features 
-- Detecting CXX compile features - done 

     BLOCK: florianwolters/catch 
----------------------------------------------------------- 
+ LIB: florianwolters_catch 
-- Writing default cmake_dummy.cpp for building library 
+ EXE: florianwolters_catch_projects_SelfTest_TestMain 
+ EXE: florianwolters_catch_projects_SelfTest_ToStringWhich 

     BLOCK: agauniyal/cbs-algorithm-sort 
----------------------------------------------------------- 
+ LIB: agauniyal_cbs-algorithm-sort 
+ EXE: agauniyal_cbs-algorithm-sort_unit_test 
-- Initializing variables to create tests with CTest 
-- Added custom target for all the tests: 
-- Following targets are defined like tests (excluded from build) 
+ TEST: agauniyal_cbs-algorithm-sort_unit_test 
-- Configuring done 
-- Generating done 
-- Build files have been written to: /home/agauniyal/projects/cbs-algorithm-sort/bii/build 
Building: "cmake" --build . 
Scanning dependencies of target florianwolters_catch 
[ 20%] Building CXX object florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o 
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:19:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:73:9: error: invalid suffix "f5615272b0fb51bcd7a669e68f3b4c7a87d93bb" on integer constant 
>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 
     ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_expression_lhs.hpp:12:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_result_builder.h:91, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_capture.hpp:11, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:28, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:43:17: error: ‘nullptr_t’ in namespace ‘std’ does not name a type 
    inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; } 
       ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:58: error: ‘template<Catch::Internal::Operator Op, class T> bool Catch::Internal::compare’ conflicts with a previous declaration 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                 ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:159:44: note: previous declaration ‘namespace Catch::Internal { }::compare’ 
    template<Operator Op, typename T> bool compare(T* lhs, int rhs) { 
              ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:53: error: ‘nullptr_t’ is not a member of ‘std’ 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:70: error: expected primary-expression before ‘*’ token 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:72: error: ‘rhs’ was not declared in this scope 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                     ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:76: error: expression list treated as compound expression in initializer [-fpermissive] 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                      ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:44: warning: variable templates only available with -std=c++14 or -std=gnu++14 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
              ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:165:78: error: expected ‘;’ before ‘{’ token 
    template<Operator Op, typename T> bool compare(std::nullptr_t, T* rhs) { 
                      ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:168:66: error: ‘std::nullptr_t’ has not been declared 
    template<Operator Op, typename T> bool compare(T* lhs, std::nullptr_t) { 
                   ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:168:44: error: redefinition of ‘template<Catch::Internal::Operator Op, class T> bool Catch::Internal::compare(T*, int)’ 
    template<Operator Op, typename T> bool compare(T* lhs, std::nullptr_t) { 
              ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_evaluate.hpp:159:44: note: ‘template<Catch::Internal::Operator Op, class T> bool Catch::Internal::compare(T*, int)’ previously declared here 
    template<Operator Op, typename T> bool compare(T* lhs, int rhs) { 
              ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_expression_lhs.hpp:13:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_result_builder.h:91, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_capture.hpp:11, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:28, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.h:54:38: error: ‘std::string Catch::toString’ redeclared as different kind of symbol 
std::string toString(std::nullptr_t); 
            ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.h:51:13: note: previous declaration ‘std::string Catch::toString(unsigned char)’ 
std::string toString(unsigned char value); 
      ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.h:54:23: error: ‘nullptr_t’ is not a member of ‘std’ 
std::string toString(std::nullptr_t); 
        ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:19:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp: In member function ‘Catch::Totals Catch::Runner::runTests()’: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:1: error: expected primary-expression before ‘<<’ token 
<<<<<<< HEAD 
^ 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:3: error: expected primary-expression before ‘<<’ token 
<<<<<<< HEAD 
^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:5: error: expected primary-expression before ‘<<’ token 
<<<<<<< HEAD 
    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:7: error: expected primary-expression before ‘<’ token 
<<<<<<< HEAD 
    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:9: error: ‘HEAD’ was not declared in this scope 
<<<<<<< HEAD 
     ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:64:3: error: expected primary-expression before ‘==’ token 
======= 
^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:64:5: error: expected primary-expression before ‘==’ token 
======= 
    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:64:7: error: expected primary-expression before ‘=’ token 
======= 
    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:65:35: error: expected primary-expression before ‘skippedTestCases’ 
      std::vector<TestCase> skippedTestCases; 
           ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:66:91: error: ‘skippedTestCases’ was not declared in this scope 
      getRegistryHub().getTestCaseRegistry().getFilteredTests(testSpec, *m_config, skippedTestCases, true); 
                         ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:69:27: error: name lookup of ‘itEnd’ changed for ISO ‘for’ scoping [-fpermissive] 
        it != itEnd; 
         ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:69:27: note: (if you use ‘-fpermissive’ G++ will accept your code) 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:73:1: error: expected primary-expression before ‘>>’ token 
>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 
^ 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:73:3: error: expected primary-expression before ‘>>’ token 
>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 
^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:73:5: error: expected primary-expression before ‘>>’ token 
>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 
    ^
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:73:7: error: expected primary-expression before ‘>’ token 
>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 
    ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:35:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.hpp: At global scope: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.hpp:163:38: error: ‘std::string Catch::toString’ redeclared as different kind of symbol 
std::string toString(std::nullptr_t) { 
            ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_expression_lhs.hpp:13:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_result_builder.h:91, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_capture.hpp:11, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:28, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.h:199:13: note: previous declaration ‘template<class T, class Allocator> std::string Catch::toString(const std::vector<_Tp, _Alloc>&)’ 
std::string toString(std::vector<T,Allocator> const& v) { 
      ^
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:35:0, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47, 
       from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_tostring.hpp:163:23: error: ‘nullptr_t’ is not a member of ‘std’ 
std::string toString(std::nullptr_t) { 
        ^
florianwolters_catch/CMakeFiles/florianwolters_catch.dir/build.make:54: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o' failed 
make[2]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o] Error 1 
CMakeFiles/Makefile2:110: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all' failed 
make[1]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all] Error 2 
Makefile:85: recipe for target 'all' failed 
make: *** [all] Error 2 
ERROR: Build failed 

和鏗鏘++,使用bii configure -D CMAKE_CXX_COMPILER=clang++

Scanning dependencies of target florianwolters_catch 
[ 20%] Building CXX object florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o 
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/projects/SelfTest/TestMain.cpp:10: 
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch.hpp:47: 
In file included from /home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/internal/catch_impl.hpp:19: 
/home/agauniyal/projects/cbs-algorithm-sort/bii/deps/florianwolters/catch/include/catch_runner.hpp:63:1: error: version control conflict marker in file 
<<<<<<< HEAD 
^ 
1 error generated. 
florianwolters_catch/CMakeFiles/florianwolters_catch.dir/build.make:54: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o' failed 
make[2]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/projects/SelfTest/TestMain.cpp.o] Error 1 
CMakeFiles/Makefile2:110: recipe for target 'florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all' failed 
make[1]: *** [florianwolters_catch/CMakeFiles/florianwolters_catch.dir/all] Error 2 
Makefile:85: recipe for target 'all' failed 
make: *** [all] Error 2 

我沒有有關這兩種編譯器專門鐺一個產生的錯誤想法。任何形式的幫助就足夠了。

+1

看起來像catch/include/catch_runner.hpp有一些diff輸出,也許是一個局部版本控制合併或什麼的。我會確保你的本地代碼庫副本是乾淨的並且是最新的。 – TartanLlama

+1

'catch_runner.hpp'的第63行有什麼?看起來像合併衝突。 –

+0

'<<<<<<< HEAD 64 ======='&'>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb' @AntonSavin –

回答

4

您很可能有git merge,正在進行或中止。這些:

<<<<<<< HEAD 

================= 

>>>>>>> 7f5615272b0fb51bcd7a669e68f3b4c7a87d93bb 

是標記git地方版本發生衝突,不能自動解決。搜索<<<<<的所有匹配項,執行所需的編輯,可能會提交併重新編譯。

如果它不是您的代碼,那麼下載或克隆將是一個快速解決方案。

+0

是的,這是它。但是biicode不會讓我修改代碼,因爲每次發現它都會下載這個文件。我已經在github回購上提出了一個問題。謝謝:) –

+0

我想補充一點,這可以解決問題,使用clang ++來編譯是可行的,但是g ++無法構建相同的錯誤。 –

+0

您可以像這樣覆蓋依賴項:http://docs.biicode.com/c++/advanced/override_deps.html – amalulla