c连接postgresql问题:无法定位序数284于动态链接库SSLEAY32.dll上

seugiser 2011-04-18 05:12:17
求助,编译没有错误,运行后出现无法定位序数284于动态链接库SSLEAY32.dll上
#include "libpq-fe.h"

char * string_for_query;
PGconn *Conn_pointer;
PGresult *result;

char* pghost = "localhost"; //IP address string is also ok
char* pgport ="5432";
char* pgoptions =NULL;
char* pgtty = NULL;
char* dbName = "school";
char* username = "postgres"; //postegres is the username that
char* password = "989911" ;//set when insalled cannot get directly

#pragma comment(lib,"C:\\Program Files\\PostgreSQL\\8.4\\lib\\libpq.lib")
int main()
{
Conn_pointer=PQsetdbLogin(pghost, pgport, pgoptions, pgtty, dbName, username, password);
if (PQstatus(Conn_pointer) == CONNECTION_BAD)
{
printf("cannot connect to the database!\n");
return -1;
}
printf ("Connect to database seccess\n");
return 0;
}
...全文
497 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
seugiser 2011-04-19
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 iihero 的回复:]
你的机器有多个SSLEAY32.dll, 把你安装pgsql用的ssleay32.dll放到system32下边试试。
[/Quote]
恩,果然是这样,是不是本来的本来的版本太低。
iihero_ 2011-04-19
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 seugiser 的回复:]

引用 1 楼 iihero 的回复:
你的机器有多个SSLEAY32.dll, 把你安装pgsql用的ssleay32.dll放到system32下边试试。

恩,果然是这样,是不是本来的本来的版本太低。
[/Quote]
是的。版本不同的ssleay32.dll所支持函数入口也不尽相同。
iihero_ 2011-04-18
  • 打赏
  • 举报
回复
你的机器有多个SSLEAY32.dll, 把你安装pgsql用的ssleay32.dll放到system32下边试试。

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧