找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1|回复: 1

给px4飞控,px4_simple_app应用添加googletest,遇到问题

[复制链接]

30

主题

26

回帖

4万

积分

管理员

积分
42066
发表于 昨天 10:12 | 显示全部楼层 |阅读模式
[21/1034] Building CXX object src/exam...MakeFiles/gtest.dir/src/gtest-all.cc.o
FAILED: src/examples/px4_simple_app/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
/usr/bin/ccache /usr/bin/c++  -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -I../../src/examples/px4_simple_app/gtest/googletest/include -I../../src/examples/px4_simple_app/gtest/googletest -O2 -g -DNDEBUG -fPIC   -Wall -Wshadow -Wundef -Wno-error=dangling-else -DGTEST_HAS_PTHREAD=1 -fexceptions -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -std=c++14 -MD -MT src/examples/px4_simple_app/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -MF src/examples/px4_simple_app/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o.d -o src/examples/px4_simple_app/gtest/googletest/CMakeFiles/gtest.dir/src/gtest-all.cc.o -c ../../src/examples/px4_simple_app/gtest/googletest/src/gtest-all.cc
In file included from ../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-matchers.h:49,
                 from ../../src/examples/px4_simple_app/gtest/googletest/include/gtest/internal/gtest-death-test-internal.h:47,
                 from ../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-death-test.h:43,
                 from ../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest.h:64,
                 from ../../src/examples/px4_simple_app/gtest/googletest/src/gtest-all.cc:38:
../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-printers.h: In instantiation of ‘int testing::internal::AppropriateResolution(FloatType) [with FloatType = float]’:
../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-printers.h:603:40:   required from here
../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-printers.h:557:13: error: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion]
  557 |     if (val >= 100000.0) {  // 100,000 to 999,999
      |         ~~~~^~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[23/1034] Generating git version header
FAILED: src/lib/version/build_git_version.h
cd /home/cuigaosheng/PX4-Autopilot && /usr/bin/python3 /home/cuigaosheng/PX4-Autopilot/src/lib/version/px_update_git_header.py /home/cuigaosheng/PX4-Autopilot/build/px4_sitl_default/src/lib/version/build_git_version.h --validate
Traceback (most recent call last):
  File "/home/cuigaosheng/PX4-Autopilot/src/lib/version/px_update_git_header.py", line 124, in <module>
    mavlink_git_version = subprocess.check_output('git rev-parse --verify HEAD'.split(),
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'rev-parse', '--verify', 'HEAD']' returned non-zero exit status 128.
[24/1034] Building CXX object src/exam...MakeFiles/gmock.dir/src/gmock-all.cc.o
ninja: build stopped: subcommand failed.


我知道答案 回答被采纳将会获得 10 金钱 已有1人回答

30

主题

26

回帖

4万

积分

管理员

积分
42066
 楼主| 发表于 昨天 10:12 | 显示全部楼层
../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-printers.h:603:40:   required from here
../../src/examples/px4_simple_app/gtest/googletest/include/gtest/gtest-printers.h:557:13: error: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Werror=double-promotion]
  557 |     if (val >= 100000.0) {  // 100,000 to 999,999
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|flightreview|小黑屋|PX4-Autopilot|PX4论坛

GMT+8, 2025-3-12 18:56 , Processed in 0.064231 second(s), 23 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表