This is my code. I don't understand why the compiler can't find the <util/Timer.h> header file.
What did I do wrong?
I have no clue , as <util/Timer.h> is not created within my project. Do I still have to add it in a cmake file as a path?
I have already checked for misspelling etc.
I get an "no such file or directory warning".
#include <gtest/gtest.h>
#define protected public
#define private public
#include "ShakingDevice.h"
#undef protected
#undef private
#include <limits.h>
#include "TestConfig.h"
#include <util/Timer.h>
class ShakingDeviceTest : public ::testing::Test {
public:
ShakingDevice *s = nullptr;
virtual void SetUp() {
//
}
virtual void TearDown() {
//
}
};
TEST_F(ShakingDeviceTest,testTime) {
ASSERT_LE(abs(time - expected), 100);
}
question from:
https://stackoverflow.com/questions/65871436/include-util-timer-h-returns-fatal-error-util-timer-h-no-such-file-or-direc 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…