C++ Eclipse可以';t find-lprotobuf
我目前正在尝试为C/C++环境设置GoogleProtobuf。 为了运行,项目需要库“libprotobuf.lib”,我保存在“C:/CustomMods”中。 现在,当我试图编译源代码时,“ld.exe”找不到指定的库。这是我的compile命令(是的,我添加了-L和-L) 我被困在这个问题上,如果有人能帮我,我会很高兴的C++ Eclipse可以';t find-lprotobuf,c++,eclipse,linker,mingw,protocol-buffers,C++,Eclipse,Linker,Mingw,Protocol Buffers,我目前正在尝试为C/C++环境设置GoogleProtobuf。 为了运行,项目需要库“libprotobuf.lib”,我保存在“C:/CustomMods”中。 现在,当我试图编译源代码时,“ld.exe”找不到指定的库。这是我的compile命令(是的,我添加了-L和-L) 我被困在这个问题上,如果有人能帮我,我会很高兴的 致以最诚挚的问候我用这篇精彩的教程设置了我的protobuf:g++“-LC:\\CustomMods”应该是g++-L“C:\\CustomMods”谢谢Praeto
致以最诚挚的问候我用这篇精彩的教程设置了我的protobuf:
g++“-LC:\\CustomMods”
应该是g++-L“C:\\CustomMods”
谢谢Praetorian的超快速回答,但不幸的是它没有帮助。我按照您的建议将编译命令更改为:g++-L“C:\\CustomMods”-o CProtoc.exe“src\\address.pb.o”“src\\CProtoc.o”-lprotobuf,但我仍然收到相同的错误!我不太确定那会起作用。我认为你问题的答案在于。使用-llibprotobuf
而不是解决此问题的-lprotobuf
,非常感谢!!
g++ "-LC:\\CustomMods" -o CProtoc.exe "src\\address.pb.o" "src\\CProtoc.o" -lprotobuf
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lprotobuf