问题遇到的现象和发生背景
因项目需要,需要用到GRPC,于是研究了下,编译源码也挺费劲,但还好,也顺利编译完成,并且成功编译通过VS2019 Qt 工程。
VS2019 Qt工程 : https://gitee.com/lanzhou-lezhi_0/window-grpc-qt-vs2019
但是,但是QtCreator创建的工程在_Windows,Linux_系统都编译不过。迟迟未能解决,特发帖,请求各位网友帮忙解决。
QtCreator工程:https://gitee.com/lanzhou-lezhi_0/grpc-qt-demo-qt-creator
问题相关代码,请勿粘贴截图
工程文件一览:
helloworld.grpc.pb.h
helloworld.pb.cc
helloworld.pb.h
helloworld.grpc.pb.cc
client/greeter_client.cc
grpc sdk一览:
bin文件:
grpc_csharp_plugin.exe
grpc_node_plugin.exe
grpc_objective_c_plugin.exe
grpc_php_plugin.exe
grpc_python_plugin.exe
grpc_ruby_plugin.exe
protoc.exe
zlibd.dll
acountry.exe
adig.exe
ahost.exe
grpc_cpp_plugin.exe
lib文件一览:
pro工程文件一览,将所有的lib文件全部包含了。由于字数限制,只是列出来了部分pro文件,全部pro文件请查看:
https://gitee.com/lanzhou-lezhi_0/grpc-qt-demo-qt-creator/blob/master/client-demo.pro
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
DEFINES += _WIN32_WINNT=0x600
SRC_PATH = $${PWD}/client
win32: GRPC_SDK_PATH = $${PWD}/grpc-windows-sdk
else:unix: GRPC_SDK_PATH = $${PWD}/grpc-linux-sdk
INCLUDEPATH += $${GRPC_SDK_PATH}/include
DEPENDPATH += $${GRPC_SDK_PATH}/include
SOURCES += \
$${SRC_PATH}/greeter_client.cc \
$${SRC_PATH}/../helloworld.grpc.pb.cc \
$${SRC_PATH}/../helloworld.pb.cc
HEADERS += \
$${SRC_PATH}/../helloworld.grpc.pb.h \
$${SRC_PATH}/../helloworld.pb.h
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lcares
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lcares
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lcares
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libcares.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libcares.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/cares.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/cares.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libcares.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lcrypto
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lcrypto
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lcrypto
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libcrypto.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libcrypto.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/crypto.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/crypto.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libcrypto.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgpr
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgpr
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgpr
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgpr.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgpr.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/gpr.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/gpr.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgpr.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc_plugin_support
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc_plugin_support
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc_plugin_support
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc_plugin_support.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc_plugin_support.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc_plugin_support.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc_plugin_support.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc_plugin_support.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc_unsecure
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc_unsecure
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc_unsecure
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc_unsecure.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc_unsecure.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc_unsecure.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc_unsecure.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc_unsecure.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc++
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc++
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc++
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc++.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc++.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc++.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc++.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc++.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc++_alts
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc++_alts
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc++_alts
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc++_alts.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc++_alts.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc++_alts.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc++_alts.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc++_alts.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc++_error_details
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc++_error_details
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc++_error_details
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc++_error_details.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc++_error_details.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc++_error_details.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc++_error_details.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc++_error_details.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc++_reflection
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc++_reflection
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc++_reflection
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc++_reflection.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc++_reflection.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc++_reflection.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc++_reflection.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc++_reflection.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpc++_unsecure
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpc++_unsecure
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpc++_unsecure
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpc++_unsecure.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpc++_unsecure.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpc++_unsecure.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpc++_unsecure.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpc++_unsecure.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lgrpcpp_channelz
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lgrpcpp_channelz
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lgrpcpp_channelz
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libgrpcpp_channelz.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libgrpcpp_channelz.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/grpcpp_channelz.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/grpcpp_channelz.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libgrpcpp_channelz.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -llibprotobuf
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -llibprotobufd
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lprotobuf
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/liblibprotobufd.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/liblibprotobufd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libprotobuf.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libprotobufd.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libprotobuf.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -llibprotobuf-lite
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -llibprotobuf-lited
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lprotobuf-lite
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/liblibprotobuf-lited.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/liblibprotobuf-lited.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libprotobuf-lite.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libprotobuf-lited.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libprotobuf-lite.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -llibprotoc
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -llibprotocd
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lprotoc
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/liblibprotocd.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/liblibprotocd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libprotoc.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libprotocd.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libprotoc.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lre2
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lre2
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lre2
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libre2.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libre2.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/re2.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/re2.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libre2.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lssl
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lssl
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lssl
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libssl.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libssl.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/ssl.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/ssl.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libssl.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lupb
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lupb
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lupb
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libupb.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libupb.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/upb.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/upb.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libupb.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lzlib
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lzlibd
else:unix: LIBS += -L$${GRPC_SDK_PATH}/lib/ -lz
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libzlib.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libzlibd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/zlib.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/zlibd.lib
else:unix: PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/libz.a
win32:CONFIG(release, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/release/ -lzlibstatic
else:win32:CONFIG(debug, debug|release): LIBS += -L$${GRPC_SDK_PATH}/lib/debug/ -lzlibstaticd
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/libzlibstatic.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/libzlibstaticd.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/release/zlibstatic.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $${GRPC_SDK_PATH}/lib/debug/zlibstaticd.lib
运行结果及报错内容
grpc.lib(rls.obj):-1: error: LNK2001: 无法解析的外部符号 "private: static unsigned __int64 __cdecl absl::lts_20211102::hash_internal::MixingHashState::CombineLargeContiguousImpl64(unsigned __int64,unsigned char const *,unsigned __int64)"
grpc.lib(rls.obj):-1: error: LNK2019: 无法解析的外部符号 "private: static void const * const absl::lts_20211102::hash_internal::MixingHashState::kSeed" (?kSeed@MixingHashState@hash_internal@lts_20211102@absl@@0QEBXEB),函数 "public: unsigned __int64 __cdecl std::_Uhash_compare<struct grpc_core::`anonymous namespace'::RlsLb::RequestKey,struct absl::lts_20211102::hash_internal::Hash<struct grpc_core::`anonymous namespace'::RlsLb::RequestKey>,struct std::equal_to<struct grpc_core::`anonymous namespace'::RlsLb::RequestKey> >::operator()<struct grpc_core::`anonymous namespace'::RlsLb::RequestKey>(struct grpc_core::`anonymous namespace'::RlsLb::RequestKey const &)
release\client-demo.exe:-1: error: LNK1120: 2 个无法解析的外部命令
我的解答思路和尝试过的方法
网上有人说是grpc.lib库编译有问题,我也不敢苟同,因为VS2019工程也使用了同样的一套库文件,确实可以正常编译,并且Server ,client可以正常helloworld通信,仅仅只是换了工程,就编译过不,所以我认为问题出在pro文件上,还请各位网友帮忙解决。