对于9.2 用vs2008
对于flex总报错,把bison下的 libintl3.dll regex2.dll libiconv2.dll m4.exe 向flex\bin下面拷一份
msvc\buildenv.pl 中的内容 $ENV{PATH}=$ENV{PATH}.';C:/pg/bison/bin;C:/pg/diffutils/bin;C:/pg/flex/bin;C:/pg/gettext/bin;C:/pg/libxml/bin;C:/pg/libxslt/bin;C:/pg/zlib/bin;C:/pg/gettext/bin;C:/pg/iconv/bin';
对于9.0beta4
如果装的中文件版VS2005,提示找不到的话,修改solution.pm
#if ($line !~ /^Microsoft/s*/(R/) Visual C/+/+ Project Builder - /D+(/d+)/.00/./d+/)#这是中文出的问题
#{
# die "Unable to determine vcbuild version from first line of output!";
#}
#if ($1 == 8) { $self->{vcver} = '8.00' }
#elsif ($1 == 9) { $self->{vcver} = '9.00' }
#else { die "Unsupported version of Visual Studio: $1" }
$self->{vcver} = '8.00'; #显示指定值
找不到libiconv2.dll ,把iconv/bin下面的iconv2.dll ,拷一份改名为 libiconv2.dll ,再放回去
需要装kfw-3-2-2.msi 和 kfw-3-2-2-sdk.zip 两个, 安装GetGnuWin32-0.6.3.exe
删掉 contrib/uuid_ossp 和 fuzzystrmatch
在config_default.pl中要改成
our $config = {
asserts=>0, # --enable-cassert
# integer_datetimes=>1, # --enable-integer-datetimes - on is now default
# float4byval=>1, # --disable-float4-byval, on by default
# float8byval=>0, # --disable-float8-byval, off by default
# blocksize => 8, # --with-blocksize, 8kB by default
# wal_blocksize => 8, # --with-wal-blocksize, 8kb by default
# wal_segsize => 16, # --with-wal-segsize, 16MB by default
ldap=>1, # --with-ldap
nls=>undef, # --enable-nls=<path>
tcl=>'C:/Tcl', # --with-tls=<path>
perl=>'C:/Perl', # --with-perl
python=>'C:/Python24', # --with-python=<path>
krb5=>'C:/pg/Kerberos', # --with-krb5=<path>
openssl=>'C:/OpenSSL', # --with-ssl=<path>
uuid=>undef, # --with-ossp-uuid
xml=>'C:/pg/libxml', # --with-libxml=<path>
xslt=>'C:/pg/libxslt', # --with-libxslt=<path>
iconv=>'C:/pg/iconv', # (not in configure, path to iconv)
zlib=>'C:/pg/zlib' # --with-zlib=<path>
};
在系统path中增加:C:/pg/zlib/bin;C:/pg/flex/bin;C:/pg/bison/bin;C:/pg/diffutils/bin;C:/pg/gettext/bin;C:/pg/iconv/bin;C:/pg/libxslt/bin;C:/pg/libxml/bin;C:/getgnuwin32/GetGnuWin32/bin;F:/pg/pgsql/bin
函数 find_my_exec 增加
if ((path = getenv("pg_exec")) && *path)
{
memset(retpath, 0, MAXPGPATH);
strcpy(retpath, path);
return 0;
}
对于8.4,
注释掉main.c中的第157行, check_root(progname); 去掉管理员不能执行,
修改pgtz.c中的 int
pg_open_tzfile(const char *name, char *canonname) 在 strcpy(fullname, pg_TZDIR());
后面加上
memset(fullname, 0, MAXPGPATH);
strcpy(fullname, "E://pg//pgsql//share//timezone");
修改path.c中的 void
get_share_path(const char *my_exec_path, char *ret_path)
//make_relative_path(ret_path, PGSHAREDIR, PGBINDIR, my_exec_path);
memset(ret_path, 0, MAXPGPATH);
strcpy(ret_path, "E://pg//pgsql//share");
修改path.c中的 void
get_pkglib_path(const char *my_exec_path, char *ret_path)
//make_relative_path(ret_path, PKGLIBDIR, PGBINDIR, my_exec_path);
memset(ret_path, 0, MAXPGPATH);
strcpy(ret_path, "E://pg//pgsql//lib");
下载文档中指定的各种类库,注意版本,把contrib下面编译通不过的项目删掉,在系统的path中增加路径,之后编译,安装
我装在了 e:/pg/pgsql 下面
initdb.exe -D e:/pg/data -E UTF8 --locale=C
createdb 时数据库名字为 当前正在使用的WINDOWS的用户名,或再去改源程序
在postgres项目的命令行参数为 --single -D e:/pg/data
之后就可以用VS2005进行调试了
本文介绍使用Visual Studio 2005编译PostgreSQL的过程,包括解决依赖库错误、配置环境变量及修改特定源代码以适应不同Windows版本等问题。
2427

被折叠的 条评论
为什么被折叠?



