CMakeFiles/position_controller_node.dir/src/nodes/position_controller_node.cpp.o:
In function `double*& google::CheckNotNull<double*&>(char const*, int, char const*, double*&)':
position_controller_node.cpp:(.text._ZN6google12CheckNotNullIRPdEET_PKciS5_OS3_[_ZN6google12CheckNotNullIRPdEET_PKciS5_OS3_]+0x86):
undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
position_controller_node.cpp:(.text._ZN6google12CheckNotNullIRPdEET_PKciS5_OS3_[_ZN6google12CheckNotNullIRPdEET_PKciS5_OS3_]+0x92):
undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
collect2: error: ld returned 1 exit status
quadrotor/ROS_quadrotor_simulator/quad_control/CMakeFiles/position_controller_node.dir/build.make:112:
recipe for target
Solution
Comment "CHECK_NOTNULL" in those files:(You can also use VSCode to find "CHECK_NOTNULL" in the folder)
You can find such code in "/usr/local/include/glog/logging.h" if you set up the glog by yourself.Those functions are called by "CHECK_NOTNULL" in logging.h.
class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage {
public:
LogMessageFatal(const char* file, int line);
LogMessageFatal(const char* file, int line, const CheckOpString& result);
__attribute__((noreturn)) ~LogMessageFatal();
};
template <typename T>
T* CheckNotNull(const char *file, int line, const char *names, T* t) {
if (t == NULL) {
LogMessageFatal(file, line, new std::string(names));
}
return t;
}
#define CHECK_NOTNULL(val) \
google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val))
Solution
Comment "CHECK_NOTNULL" in those files:(You can also use VSCode to find "CHECK_NOTNULL" in the folder)
You can find such code in "/usr/local/include/glog/logging.h" if you set up the glog by yourself.Those functions are called by "CHECK_NOTNULL" in logging.h.