编译Google Test时出现g ++致命错误

时间:2017-03-30 18:40:41

标签: c++ unit-testing makefile compiler-errors googletest

我正在尝试使用Google Test编译一些测试。我正在使用GTEST附带的示例makefile,但是来自不同的目录。我添加了一些make目标来编译我的测试和源代码,但是没有触及Google Test位,但是编译Google测试源失败并显示此通知:

    g++ -isystem ~/stm32/googletest/googletest/include -I~/stm32/googletest/googletest -g -Wall -Wextra -pthread -c \
            ~/stm32/googletest/googletest/src/gtest-all.cc
/home/nuclear_kiwi/stm32/googletest/googletest/src/gtest-all.cc:42:24: Fatal Error: src/gtest.cc: File or directory not found
     #include "src/gtest.cc"

为什么这会失败,即使在对编译器的调用中提供了源路径?

1 个答案:

答案 0 :(得分:0)

您需要更改:

UPDATE A
SET TotalSalaryOfMonth = AttendanceOfCurrentMonth * MonthlySalary
FROM tblEmpSalary A
INNER JOIN tblEmployee B
    ON A.EmpId = B.EmpId

为:

-I~/stm32/googletest/googletest

Bash仅在-I ~/stm32/googletest/googletest 出现时才识别代字号前缀运算符 一个字的开头。 3.4.3. Tilde expansion