当前位置:网站首页>Error reported when compiling basalt
Error reported when compiling basalt
2022-06-23 01:25:00 【Blue area soldier】
Write the summary at the front
- Please use GCC9 Or above basalt
- If apt Installed fmt Outdated Version , Please compile and install a higher version of fmt
- Use CLion When compiling, please configure the runtime LD_LIBRARY_PATH
Report a mistake :
github/basalt/thirdparty/Pangolin/src/image/image_io_lz4.cpp:42:12: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation]
strncpy(header.magic,"LZ4",3);
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
This error is due to CMake Of C++ Added... To the compilation options -Werror, Treat all warnings as errors , This strncpy function , Because it is C Function of style , Copy string is not followed by ’\0’ This terminator , But there is no need to add a terminator here , So full text search in the project -Werror The location of , Then add a blank space to the back -Wno-error=stringop-truncation Just go .
Error reporting II :
In file included
from XXX/github/basalt/thirdparty/basalt-headers/thirdparty/eigen/Eigen/src/Geometry/AlignedBox.h:49,
from XXX/github/basalt/thirdparty/Pangolin/include/pangolin/plot/range.h:43,
from XXX/github/basalt/thirdparty/Pangolin/include/pangolin/image/image_utils.h:34,
from XXX/github/basalt/thirdparty/Pangolin/include/pangolin/handler/handler_image.h:30,
from /home/vipl/VIPL2021-CJ/github/basalt/thirdparty/Pangolin/src/handler/handler_image.cpp:1:
/home/vipl/VIPL2021-CJ/github/basalt/thirdparty/basalt-headers/thirdparty/eigen/Eigen/src/Geometry/InternalHeaderCheck.h:2:2: error: #error "Please include Eigen/Geometry instead of including headers inside the src directory directly."
#error "Please include Eigen/Geometry instead of including headers inside the src directory directly."
This error is reported because the code checks whether it directly contains AlignedBox.h, That is to say range.h Used directly in
#include <Eigen/src/Geometry/AlignedBox.h>
And then in AlignedBox.h in , There is one #include "./InternalHeaderCheck.h" Directly checked out .
So the report is wrong , Need to put range.h Medium
#include <Eigen/src/Geometry/AlignedBox.h>
It is amended as follows
#include <Eigen/Geometry>
Error reporting 3 :
[ 87%] Building CXX object CMakeFiles/basalt.dir/src/utils/time_utils.cpp.o
In file included from /home/vipl/VIPL2021-CJ/github/basalt/src/utils/time_utils.cpp:2:
/home/vipl/VIPL2021-CJ/github/basalt/include/basalt/utils/format.hpp: In instantiation of ‘basalt::literals::operator""_format(const char*, size_t)::<lambda(auto:1&& …)> [with auto:1 = {const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, int&, double&, double&, double&, double&}]’:
/home/vipl/VIPL2021-CJ/github/basalt/src/utils/time_utils.cpp:134:56: required from here
/home/vipl/VIPL2021-CJ/github/basalt/include/basalt/utils/format.hpp:53:23: error: no matching function for call to ‘format(std::string_view, const std::__cxx11::basic_string&, int&, double&, double&, double&, double&)’
return fmt::format(std::string_view(s, n), args...);
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This report is wrong GCC The reason for the version , I'm using GCC8.3.0, Although it has been fully supported C++17 了 , But I don't know why it can't be opened C++17 Characteristics of , I don't want to study this problem too deeply , Direct download GCC9 Or above , Then compile and install , Use update-alternative Version management , It is important to note that LD_LIBRARY_PATH Add inside GCC New version Library Directory ,fmt Also use new GCC Compile and install , And don't use apt Way to install fmt, I'm using deepin,apt From the source libfmt Kuo is 5.2.1 As if , Too old , Direct download 8.1.1 Version of , Use the new GCC Install after compilation , Then compile
Error reporting 4 :
Click on debug When debugging , The executable shows a link to /lib/x86_64-linux-gnu/libstdc++.so… This library , This library does not support new GLIBCXX.3.29 wait 
This is because CLion Environment variables are not set in the runtime configuration LD_LIBRARY_PATH, The system library directory used directly , Good configuration LD_LIBRARY_PATH Then you can run
stay CLION Operation of -> Edit the configuration -> Select the one you want on the left debug The program , Then set the environment variable .
边栏推荐
- [hdu] p1466 calculate the number of intersections of straight lines
- [hdu] P7079 Pty loves lines
- Pat class A - 1013 battle over cities
- 时间复杂度
- SQL programming task06 assignment - Autumn recruit secret script ABC
- Day575: divide candy
- Shell logs and printouts
- [22 summer reconstruction 1] codeworks round 791 (Div. 2)
- Real topic of the 2020 Landbridge cup provincial competition - go square (dp/dfs)
- [luogu] p1083 [noip2012 improvement group] classroom borrowing (difference)
猜你喜欢

The devil cold rice # 099 the devil said to travel to the West; The nature of the boss; Answer the midlife crisis again; Specialty selection

MySQL-Seconds_ behind_ Master accuracy error

Charles garbled code problem solving

SAP ui5 application development tutorial 103 - how to consume third-party libraries in SAP ui5 applications

崔鹏团队:万字长文梳理「稳定学习」全景图

Sélecteur de hiérarchie

LeetCode 206. Reverse linked list (iteration + recursion)
![[launch] redis Series 2: data persistence to improve availability](/img/f4/5bc7ca3e17c6656e71df515182842e.png)
[launch] redis Series 2: data persistence to improve availability
![[machine learning watermelon book] update challenge [Day1]: 1.1 INTRODUCTION](/img/f6/b0df192502a59a32d8bac8c0862d02.png)
[machine learning watermelon book] update challenge [Day1]: 1.1 INTRODUCTION

SAP ui5 application development tutorial 103 - how to consume the trial version of the third-party library in SAP ui5 applications
随机推荐
SFOD:无源域适配升级优化,让检测模型更容易适应新数据
3D打印微组织
E-R图
Vector 2 (friend and copy construction)
Shell 日志与打印输出
Sfod: passive domain adaptation and upgrade optimization, making the detection model easier to adapt to new data
层次选择器
Pat class A - 1014 waiting in line (bank queuing problem | queue+ simulation)
Sélecteur de hiérarchie
Cadence spb17.4 - Allegro - optimiser la spécification de l'angle de connexion de la polyligne pour une seule ligne électrique - polyligne à arc
Webdriver and selenium Usage Summary
[luogu] p1083 [noip2012 improvement group] borrow classroom (line segment tree)
基于深度学习的视觉目标检测技术综述
[hdu] P7079 Pty loves lines
LINQ 查詢
SQL programming task05 job -sql advanced processing
leetcode 91. Decode ways (medium)
LeetCode 206. Reverse linked list (iteration + recursion)
Char[], char *, conversion between strings
OOP multiple storage (class template)