跟进pg_config之后,我仍然很难让/src/tutorial子目录编译。
我正在Windows 7上运行cygwin,这并不是一个理想的环境,但我试图获得一个PostgreSQL扩展,它是在这个版本中编写的,它使用基于Windows的接口来工作。一旦运行,我将迁移到Linux和更好的PostgreSQL。
回到问题上:
当我在/src/tutorial上运行make时,我得到了以下内容。我没有改变目录中的任何东西。
$ make
dlltool --export-all --output-def complex.def complex.o
dllwrap -o complex.dll --def complex.def complex.o -L/usr/lib -lpostgres -L/usr/ lib -lpostgres
rm -f complex.def
gcc -O2 -pipe -Wall -Wmissing-prototypes -Wpointer-arith -Winline -Wdeclaration -after-statement -Wendif-labels -fno-strict-aliasing -fwrapv -I. -I/usr/include /postgresql/server -I/usr/include/postgresql/internal -c -o funcs.o funcs.c
funcs.c:19:1: warning: ‘Pg_magic_func’ redeclared without dllimport attribute: p revious dllimport ignored
funcs.c: In function ‘copytext’:
funcs.c:74:2: warning: implicit declaration of function ‘SET_VARSIZE’
dlltool --export-all --output-def funcs.def funcs.o
dllwrap -o funcs.dll --def funcs.def funcs.o -L/usr/lib -lpostgres -L/usr/lib -l postgres
funcs.o:funcs.c:(.text+0xb6): undefined reference to `_SET_VARSIZE'
funcs.o:funcs.c:(.text+0x142): undefined reference to `_SET_VARSIZE'
collect2: ld returned 1 exit status
dllwrap: gcc exited with status 1我不知道哪些是需要包含在函数中的正确的头文件。
此错误发生在未修补的8.3.1中。
谢谢
编辑
我在我的安装中发现了上面的问题。/src/tutorial下的Makefile运行
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)因为我运气不好,除了我的pg_config之外,还有另外一个installation-folder/bin
因此,一旦我修复了这个问题,/src/tutorial下的所有东西都会正常生成。
发布于 2013-04-13 03:35:46
正如注释中提到的,这一次是由错误版本的额外pg_config造成的。很可能这也不是错误版本的唯一方面。使用的旧头文件将是近端原因,pg_config将指向旧的头文件。
通常,这里正确的做法是定位两个文件的所有版本,然后确定使用哪个版本。这些档案是:
一旦完成,它应该是一个简单的模式,以确定哪一个要删除或移出脚本可以找到的地方。
https://stackoverflow.com/questions/12907015
复制相似问题