我知道这个问题与其他问题相似,但似乎都没有解决我的问题。
症状
gdb_test
使用 gdb轻松构建和运行。- 程序
SIGILL
的:
~/projects/gdb_test/build> gdb gdb_test
GNU gdb (GDB; openSUSE Tumbleweed) 8.3.1
(...)
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gdb_test...
(gdb) r
Starting program: /home/jaques/projects/gdb_test/build/gdb_test
Missing separate debuginfos, use: zypper install glibc-debuginfo-2.31-5.9.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffebae8700 (LWP 1210)]
[New Thread 0x7fffeb2e7700 (LWP 1211)]
[New Thread 0x7fffe6ae6700 (LWP 1212)]
Thread 1 "gdb_test" received signal SIGILL, Illegal instruction.
0x00007ffff7d90617 in ?? () from /usr/lib64/libopencv_gapi.so.4.2
(gdb)
示例项目:
“主.cpp”
#include <iostream>
int main(int argc, char **argv) {
std::cout << "Hello, world!" << std::endl;
return 0;
}
CMakeLists.txt:
cmake_minimum_required(VERSION 3.0)
project(gdb_test)
find_package( OpenCV REQUIRED ) # Works fine if this line is removed.
add_executable(gdb_test main.cpp)
install(TARGETS gdb_test RUNTIME DESTINATION bin)
环境
- 运行更新的 OpenSuse 的 Linux 机器:
NAME="openSUSE Tumbleweed" 版本="20200622"
- G++ 10.1.1
- GDB 8.3.1
- opencv-devel 4.2.0-4.1
- 拱 x86_64
- 未剥离,带有调试信息可执行文件:
gdb_test/build> 文件 gdb_test gdb_test:ELF 64 位 LSB 可执行文件,x86-64,版本 1 (SYSV),动态链接,解释器 /lib64/ld-linux-x86-64.so.2,BuildID[sha1]=28f8c835686d92c15cb8b0cfb201c5f45a8a89c7 ,对于 GNU/Linux 3.2.0,带有 debug_info,未剥离
有什么问题?
怎么解决?
有任何想法吗?
谢谢。