注册

c++ sdk编译问题

下载了linux sdk 编译链接出现如下错误:
 
$make
g++ -o demo chat.o event_loop.o main.o window.o -L../../release -pthread -leasemob -lcurl -lssl -lcrypto -lz -lresolv -lncurses -lsqlite3 -lidn
chat.o: In function `Demo::Chat::onReceiveMessage(std::shared_ptr)':
chat.cpp:(.text+0x13f9): undefined reference to `_ZNK7easemob17EMTextMessageBody4textB5cxx11Ev'
chat.cpp:(.text+0x141a): undefined reference to `_ZN7easemob9EMMessage2toB5cxx11Ev'
chat.cpp:(.text+0x143b): undefined reference to `_ZN7easemob9EMMessage4fromB5cxx11Ev'
chat.o: In function `Demo::Chat::onReceiveOfflineMessage(std::vector, std::allocator > > const&)':
chat.cpp:(.text+0x1810): undefined reference to `_ZNK7easemob17EMTextMessageBody4textB5cxx11Ev'
chat.cpp:(.text+0x1831): undefined reference to `_ZN7easemob9EMMessage2toB5cxx11Ev'
chat.cpp:(.text+0x1852): undefined reference to `_ZN7easemob9EMMessage4fromB5cxx11Ev'
chat.o: In function `Demo::Chat::HandleCommand(std::__cxx11::basic_string, std::allocator >)':
chat.cpp:(.text+0x1ddb): undefined reference to `easemob::EMChatClient::createAccount(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2065): undefined reference to `easemob::EMChatClient::login(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x25e4): undefined reference to `easemob::EMTextMessageBody::EMTextMessageBody(std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2625): undefined reference to `easemob::EMMessage::createSendMessage(std::__cxx11::basic_string, std::allocator > const&, std::__cxx11::basic_string, std::allocator > const&, easemob::EMMessageBody*, easemob::EMMessage::EMChatType)'
chat.cpp:(.text+0x27be): undefined reference to `_ZN7easemob9EMMessage2toB5cxx11Ev'
chat.cpp:(.text+0x27e2): undefined reference to `_ZN7easemob9EMMessage4fromB5cxx11Ev'
chat.cpp:(.text+0x29fe): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2bd3): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x2ed7): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x3095): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.cpp:(.text+0x3329): undefined reference to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)'
chat.o:chat.cpp:(.text+0x3532): more undefined references to `easemob::EMError::EMError(int, std::__cxx11::basic_string, std::allocator > const&)' follow
collect2: error: ld returned 1 exit status
make: *** [demo] Error 1
已邀请:
检查../../release目录是否存在, 解压缩包会生成release文件夹,不要更改release文件夹的名称
$file demo
demo: ELF 64-bit LSB  executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=b784019fd4f1de13e27063608901facd9b2b8885, not stripped

 
libeasemob.a生成的目标机器:x86-64
需要确认的编译平台是否x86-64

要回复问题请先登录注册