我想在Visual Studio 2008下使用libgadu(即时消息协议库)。 我已经下载了libgadu http://toxygen.net/libgadu/files/libgadu-1.8.2.tar.gz,并在cygwin下编译了它 - ./configure,make,make install。 文件libgadu.h出现在include文件夹中,我复制到另一个文件夹,在VS中标记为包含files目录。在Windows下编译libgadu
我想从文件
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <libgadu.h>
using namespace std;
int main(void)
{
char password[]= "haslo";
struct gg_session *sesja;
struct gg_login_params parametry;
struct gg_event *zdarzenie;
memset(¶metry, 0, sizeof(parametry));
parametry.uin = 12345;
parametry.password = password;
parametry.async = 1;
parametry.status = GG_STATUS_INVISIBLE;
sesja = gg_login(¶metry);
if (!sesja) {
cout << "Can't connect" << endl;
exit(1);
}
system("PAUSE");
}
编译代码在编译期间我收到两个错误:
Error 1 error LNK2019: unresolved external symbol _gg_login referenced in function _main 1.obj
Error 2 fatal error LNK1120: 1 unresolved externals
我应该怎么做呢?
作为编译.c文件的结果,该符号可能位于.o(或.obj)文件中。 – 2008-12-06 00:46:33