注册

即时通讯云Linux SDK里的demo无法编译

下载了即时通讯云Linux SDK,但其中的demo无法编译,报错如下:
g++  -std=c++11 -Wall -I../../release//include  -c -o window.o window.cpp
g++  -std=c++11 -Wall -I../../release//include  -c -o main.o main.cpp
g++  -std=c++11 -Wall -I../../release//include  -c -o chat.o chat.cpp
g++  -std=c++11 -Wall -I../../release//include  -c -o event_loop.o event_loop.cpp
g++ -o demo window.o main.o chat.o event_loop.o -L../../release/ -pthread -leasemob -lcurl -lssl -lz -lncurses -lsqlite3
chat.o: In function `Demo::Chat::Chat(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)':
chat.cpp:(.text+0x43a): undefined reference to `easemob::EMChatConfigs::EMChatConfigs(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, unsigned int)'
chat.o: In function `Demo::Chat::onReceiveMessages(std::vector, std::allocator > > const&)':
chat.cpp:(.text+0x15eb): undefined reference to `easemob::EMMessage::to[abi:cxx11]() const'
chat.cpp:(.text+0x1605): undefined reference to `easemob::EMMessage::from[abi:cxx11]() const'
chat.o: In function `Demo::Chat::HandleCommand(std::__cxx11::basic_string, std::allocator >)':
chat.cpp:(.text+0x1b6e): undefined reference to `easemob::EMClient::createAccount(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x1df8): undefined reference to `easemob::EMClient::login(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x238f): undefined reference to `easemob::EMTextMessageBody::EMTextMessageBody(std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x23fa): undefined reference to `easemob::EMMessage::createSendMessage(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, std::shared_ptr const&, easemob::EMMessage::EMChatType)'
chat.cpp:(.text+0x25b5): undefined reference to `easemob::EMMessage::to[abi:cxx11]() const'
chat.cpp:(.text+0x25cf): undefined reference to `easemob::EMMessage::from[abi:cxx11]() const'
chat.cpp:(.text+0x27d4): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x29a9): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2cb6): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2e74): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x3111): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.o:chat.cpp:(.text+0x331a): more undefined references to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)' follow
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'demo' failed
make: *** [demo] Error 1

确定libeasemob.a文件在../../release目录下
请问这个要怎么解决?
系统Ubuntu 16.04 LTS
GCC 5.4.0
已邀请:
这个看起来就是找不到库
export LD_DEBUG=files
调试下
export LD_DEBUG=xxx 后面可以接许多参数,你可以修改尝试下,帮助调试
 
用的是静态库,不是-leasemob, 直接libeasemob.a
问了一下,是gcc版本过高导致的,降到4.8.5后问题解决
请问问题解决了吗 ?
 

要回复问题请先登录注册