我正在尝试在solaris 11.2上编译python 3.7。在链接阶段之前,编译似乎没有错误。我没有root访问权限。
我尝试了以下方法:
./configure --prefix=/appgroup/appuser
make
./configure --prefix=/appgroup/appuser --enable-shared
make
两个错误均出现:
gcc -o python Programs/python.o -Wl,-R,/appgroup/appuser/scripts/lib -L. -lpython3.7m -lsocket -lnsl -lintl -ldl -lsendfile -lm
Undefined first referenced
symbol in file
libintl_bind_textdomain_codeset ./libpython3.7m.so
libintl_gettext ./libpython3.7m.so
libintl_textdomain ./libpython3.7m.so
libintl_dcgettext ./libpython3.7m.so
libintl_bindtextdomain ./libpython3.7m.so
libintl_dgettext ./libpython3.7m.so
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `python'
我认为该错误是基于/usr/include/libintl.h和/usr/local/include/libintl.h之间的冲突,因为/ usr / local / include中的那个有那些变量,而/ usr / include不会。
我尝试设置CFLAGS =“-I / usr / include -I / usr / local / include”和CFLAGS =“-I / usr / local / include -I / usr / include”,但结果是一样。
有什么想法吗?
答案 0 :(得分:1)
它现在正在工作。谢谢paulsm4。
make clean
./configure --prefix=/apps/myapp/scripts CFLAGS="-I/usr/local/include -I/usr/include"
cp pyconfig.h pyconfig.h-1018-1200
vim +/INTL pyconfig.h
diff pyconfig.h pyconfig.h-1018-1200
568c568
< /* #undef HAVE_LIBINTL_H */
---
> #define HAVE_LIBINTL_H 1
1463c1463
< /* #undef WITH_LIBINTL */
---
> #define WITH_LIBINTL 1
make
make test
... stopped test with Ctrl-C
... (this machine is in a production environment without internet access)
make install
python3 -V
Python 3.7.0
仍然有几个问题,但确实可以加载。