请问BCB调用hiredis.lib库会提示找不到外部函数
源码如下,hiredis.lib库是VS2015编译的静态库,已经用BCB工具转换了
测试的时候出现了找不到外部库,求各位大神指点一下
#pragma hdrstop
#pragma argsused
#ifdef _WIN32
#include <tchar.h>
#else
typedef char _TCHAR;
#define _tmain main
#endif
#include <winsock2.h>
#include <stdio.h>
using namespace std;
#include "hiredis/hiredis.h"
#pragma comment(lib,"hiredis.lib")
int _tmain(int argc, _TCHAR* argv[])
{
unsigned int j;
redisContext *c;
redisReply *reply;
c = redisConnect((char*)"127.0.0.1", 6379);
if (c->err) {
printf("Connection error: %s\n", c->errstr);
}
/* PING server */
reply = (redisReply *)redisCommand(c, "PING");
printf("PING: %s\n", reply->str);
freeReplyObject(reply);
/* Set a key */
reply = (redisReply *)redisCommand(c, "SET %s %s", "foo", "hello world");
printf("SET: %s\n", reply->str);
freeReplyObject(reply);
/* Set a key using binary safe API */
reply = (redisReply *)redisCommand(c, "SET %b %b", "bar", 3, "hello", 5);
printf("SET (binary API): %s\n", reply->str);
freeReplyObject(reply);
/* Try a GET and two INCR */
reply = (redisReply *)redisCommand(c, "GET foo");
printf("GET foo: %s\n", reply->str);
freeReplyObject(reply);
reply = (redisReply *)redisCommand(c, "INCR counter");
printf("INCR counter: %lld\n", reply->integer);
freeReplyObject(reply);
/* again ... */
reply = (redisReply *)redisCommand(c, "INCR counter");
printf("INCR counter: %lld\n", reply->integer);
freeReplyObject(reply);
/* Create a list of numbers, from 0 to 9 */
reply = (redisReply *)redisCommand(c, "DEL mylist");
freeReplyObject(reply);
for (j = 0; j < 10; j++) {
char buf[64];
sprintf_s(buf, 64, "%d", j);
reply = (redisReply *)redisCommand(c, "LPUSH mylist element-%s", buf);
freeReplyObject(reply);
}
/* Let's check what we have inside the list */
reply = (redisReply *)redisCommand(c, "LRANGE mylist 0 -1");
if (reply->type == REDIS_REPLY_ARRAY) {
for (j = 0; j < reply->elements; j++) {
printf("%u) %s\n", j, reply->element[j]->str);
getchar();
}
}
freeReplyObject(reply);
return 0;
}
错误问题:
[ilink32 Error] Error: Unresolved external '_redisConnect' referenced from C:\USERS\MAYN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\REDISTEST.OBJ
[ilink32 Error] Error: Unresolved external '_redisCommand' referenced from C:\USERS\MAYN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\REDISTEST.OBJ
[ilink32 Error] Error: Unresolved external '_freeReplyObject' referenced from C:\USERS\MAYN\DOCUMENTS\EMBARCADERO\STUDIO\PROJECTS\WIN32\DEBUG\REDISTEST.OBJ
[ilink32 Error] Error: Unable to perform link