c++ protobuf segfault when linked statically

58 views
Skip to first unread message

Armen Alaverdyan

unread,
Dec 11, 2021, 6:47:50 AM12/11/21
to Protocol Buffers
I am absolutely sure that this is my error, but i can't figure out what's wrong. When linking protobuf statically i am getting segfault in

void Message::CopyFrom(const Message& from)

But when linking dynamically everything works fine. Protobuf is inlcuded in cmake like following:

target_link_libraries(my_binary ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
target_link_libraries(my_binary ${PROTOBUF_LIB_DIRECTORY}/libprotobuf.a)

No linker errors also.
Reply all
Reply to author
Forward
0 new messages