我完全不知道为什么会这样。相同的代码在Windows上运行良好。使用gcc 7.3.0和protobuf版本3.6.1可以很好地编译到ubuntu linux。我使用vcpkg构建它,并使用编译的协议从.proto文件生成.cc和.h文件。但是,当我启动该应用程序时,它立即崩溃。这是堆栈跟踪。
0 0x00007ffff70e3e97 __GI_raise /build/glibc-OTsEL5/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c 51
1 0x00007ffff70e5801 __GI_abort /build/glibc-OTsEL5/glibc-2.27/stdlib/abort.c 79
2 0x00007ffff7ad88b7 ??
3 0x00007ffff7adea06 ??
4 0x00007ffff7adea41 std::terminate()
5 0x00007ffff7adec74 __cxa_throw
6 0x00007ffff7ada979 ??
7 0x0000555555597655 std::call_once<void (&)()> /usr/include/c++/7/mutex 698
8 0x0000555555594c34 google::protobuf::internal::call_once<std::once_flag&, void (&)()> /home/ubuntu/Documents/vcpkg/installed/x64-linux/include/google/protobuf/stubs/once.h 91
9 0x00005555555898a8 protobuf_ProtoCombined_2eproto::AddDescriptors /home/ubuntu/Documents/fastobjtobinary/ProtoCombined.pb.cc 249
10 0x0000555555594141 protobuf_ProtoCombined_2eproto::StaticDescriptorInitializer::StaticDescriptorInitializer /home/ubuntu/Documents/fastobjtobinary/ProtoCombined.pb.cc 254
11 0x0000555555591ad6 __static_initialization_and_destruction_0 /home/ubuntu/Documents/fastobjtobinary/MyProtoCombined.pb.cc 256
12 0x0000555555591aec _GLOBAL__sub_I__ZN13ProtoCombined33_BinaryMeshFull_default_instance_E /home/ubuntu/Documents/fastobjtobinary/ProtoCombined.pb.cc 2540
13 0x00005555556ecfcd __libc_csu_init
14 0x00007ffff70c6b28 __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c 266
15 0x000055555556892a _start
欢迎提出任何建议!