gaoxiang12 / slambook

MIT License
6.76k stars 3.24k forks source link

ch7 的 orb_self.cpp 编译错误:/usr/lib/gcc/x86_64-linux-gnu/7/include/popcntintrin.h:35:1: error: inlining failed in call to always_inline #293

Closed shaoxh closed 2 years ago

shaoxh commented 2 years ago

第七章的地方遇到了编译错误。其他的 cpp 文件编译没问题。 有人知道原因吗? [1/2] Building CXX object CMakeFiles/orb_self.dir/orb_self.cpp.o FAILED: CMakeFiles/orb_self.dir/orb_self.cpp.o /usr/bin/c++ -DENABLE_SSE -I/usr/include/eigen3 -isystem /usr/local/include/opencv -g -std=gnu++14 -MD -MT CMakeFiles/orb_self.dir/orb_self.cpp.o -MF CMakeFiles/orb_self.dir/orb_self.cpp.o.d -o CMakeFiles/orb_self.dir/orb_self.cpp.o -c /home/shawn/Documents/slambook2/ch7/orb_self.cpp /home/shawn/Documents/slambook2/ch7/orb_self.cpp: In function ‘void BfMatch(const std::vector<std::vector >&, const std::vector<std::vector >&, std::vector&)’: /home/shawn/Documents/slambook2/ch7/orb_self.cpp:402:28: warning: narrowing conversion of ‘i1’ from ‘size_t {aka long unsigned int}’ to ‘int’ inside { } [-Wnarrowing] cv::DMatch m{i1, 0, 256}; ^ In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/smmintrin.h:811:0, from /usr/lib/gcc/x86_64-linux-gnu/7/include/nmmintrin.h:31, from /home/shawn/Documents/slambook2/ch7/orb_self.cpp:7: /usr/lib/gcc/x86_64-linux-gnu/7/include/popcntintrin.h:35:1: error: inlining failed in call to always_inline ‘int _mm_popcnt_u32(unsigned int)’: target specific option mismatch _mm_popcnt_u32 (unsigned int __X) ^~~~~~ /home/shawn/Documents/slambook2/ch7/orb_self.cpp:407:35: note: called from here distance += _mm_popcnt_u32(desc1[i1][k] ^ desc2[i2][k]);


ninja: build stopped: subcommand failed.
BTREE-C802 commented 2 years ago

您好,我叫旷鸿章,我已经收到了你的邮件。谢谢!