-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MacOS下链接找不到protobuf #344
Comments
你好,可以把安装protobuf的步骤和路径发一下吗? |
这样应该就不会链接到不一样的lib了。具体通用一点的改法我再定位一下,感谢~~ |
你的截图:set(Protobuf_LIBRARIES xxx),这里应该需要指定的是lib的名字而不是路径,比如/opt/homebrew/Cellar/protobuf/24.4/lib/libprotobuf.24.4.0.dylib 刚才显示指定了cmake里这个lib的名字为${Protobuf_LIBRARIES},PR是#345 ,你可以从我的fork上拉一份试试。P.S. 我看你的pb比较新,可以保留你的C++版本改到17那行,其他应该不需要改了。这样试试? |
我重新拉了一份代码切换到你提供的分支,并重新修改了Protobuf_LIBRARIES,其他都没有修改,和你的PR上一样,但还是报一样的错误😭 |
可以检查一下是否有可能先前安装的版本还在?你可以把变量打出来检查一下是否符合预期:
还有一个办法是在~/.zshrc文件加几行,优先指定执行时找的路径:比如把下面的
|
终于成功啦!果然是忘记把之前的protobuf路径从zshrc里删除。谢谢! |
你可以自己改一下。 |
The text was updated successfully, but these errors were encountered: