apache / rocketmq-clients

RocketMQ Clients - Collection of Client Bindings for Apache RocketMQ
https://rocketmq.apache.org/
Apache License 2.0
330 stars 216 forks source link

[Bug] openssl symbol confilcts while building c++ client on windows #847

Closed natsucity closed 1 week ago

natsucity commented 1 month ago

Before Creating the Bug Report

Programming Language of the Client

C++

Runtime Platform Environment

Windows 11 23H2

RocketMQ Version of the Client/Server

latest repository

Run or Compiler Version

Visual Studio 2022 CMake 3.28.3

Describe the Bug

An error occured when building c++ version of rocket clients. gRPC v1.46.3 gflags v2.2.2 openssl v3.3.1

Screenshot 2024-10-16 161145

Steps to Reproduce

follow the official building instructions.

What Did You Expect to See?

target rocketmq_shared successfully built

What Did You See Instead?

error LNK2019

Additional Context

I found that the target 'rocketmq_shread' uses header files from OpenSSL libs requried by the building instruction while it linked to 'crypto.lib' shipped by google gRPC which actually bulit from boringssl. The unfound symbol EVP_MD_get_szie from TlsHelper.cpp comes from macro EVP_MD_size, which, in the context of openssl, expands to the fucntion EVP_MD_get_size. I know little about openssl or boringssl, but I found that the symbol EVP_MD_size does exists in 'crypto.lib'. So I use the code to bridge the call the EVP_MD_size function. `

undef EVP_MD_size

extern "C" { int EVP_MD_size(const EVP_MD *md); } ` The target can be built successfully, but I'm not sure if this can work properly.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open for 30 days with no activity. It will be closed in 3 days if no further activity occurs.

github-actions[bot] commented 1 week ago

This issue was closed because it has been inactive for 3 days since being marked as stale.