MathewWi / sylverant

Automatically exported from code.google.com/p/sylverant
0 stars 0 forks source link

Python3.2 Incompatibility: undefined reference to PyString_FromStringAndSize, PyString_FromString and Py_InitModule3 #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Running make all in the ship_server directory against Python 3.2
2.
3.

What is the expected output? What do you see instead?

I expect the make to complete.

Instead I receive the error;
..
libtool: link: gcc -I/usr/local/include -I/usr/include/libxml2 
-I/usr/include/p11-kit-1 -I/usr/include/python3.2mu -I/usr/include/python3.2mu 
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -fwrapv -O3 -Wall 
-Wstrict-prototypes -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector 
--param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -I/usr/local/include 
-I/usr/include/libxml2 -I/usr/include/p11-kit-1 -DHAVE_PYTHON -Wall 
-DSVN_REVISION=\"\" -Wl,-export-dynamic -o ship_server block.o clients.o 
commands.o gm.o lobby.o ship.o ship_packets.o ship_server.o shipgate.o utils.o 
subcmd.o list.o items.o word_select.o quests.o bans.o lookup3.o scripts.o 
admin.o  -L/usr/local/lib -lmini18n /usr/local/lib/libsylverant.a -lxml2 
-lgnutls -lpthread -ldl -lutil -lm -lpython3.2mu
clients.o: In function `Client_addr':
/home/user/psobb/sylverant/trunk/ship_server/src/clients.c:884: undefined 
reference to `PyString_FromStringAndSize'
scripts.o: In function `script_add':
/home/user/psobb/sylverant/trunk/ship_server/src/scripts.c:382: undefined 
reference to `PyString_FromString'
scripts.o: In function `init_scripts':
/home/user/psobb/sylverant/trunk/ship_server/src/scripts.c:478: undefined 
reference to `Py_InitModule3'
collect2: ld returned 1 exit status
make[1]: *** [ship_server] Error 1
make[1]: Leaving directory `/home/user/psobb/sylverant/trunk/ship_server'
make: *** [all-recursive] Error 1

What version of the product are you using? On what operating system?

The latest svn pull of sylvanet server (Feb. 14 2012)
Arch Linux 64bit

Please provide any additional information below.

From what I've learned python3 doesn't include
PyString_FromStringAndSize
PyString_FromString
Py_InitModule3

Original issue reported on code.google.com by nemesys...@gmail.com on 16 Feb 2012 at 8:05

GoogleCodeExporter commented 9 years ago
At the moment, only Python 2.x is supported. The Python scripting support in 
the server was never finished properly anyway, so the best approach is probably 
to just take it out by commenting out the AM_PATH_PYTHON line in the 
configure.ac. I'll probably fix things with Python 3 when I actually make the 
scripting support more useful.

I do have a couple of other, unrelated to the bug things to note. If you're 
trying to use Sylverant for Blue Burst (as it appears you are based on the path 
you're building it out of), most things are still not supported. Blue Burst 
users still cannot join games (they can create their own game though), nor can 
they gain experience or items from enemies. These are all things that can and 
will be fixed in due time. Also, Issue #1 is still a problem with Linux, so its 
a really bad idea to be using Sylverant with Linux anyway.

Original comment by bluecrab on 16 Feb 2012 at 2:34

GoogleCodeExporter commented 9 years ago
Long time no bug reports from me... until now. I am experiencing what I believe 
may be a related issue.

What steps will reproduce the problem?
1.Running make all in the ship_server directory against Python

What is the expected output? What do you see instead?

I expect the make to successfully complete.

Making all in l10n
make[1]: Entering directory `/usr/local/sylverant/trunk/ship_server/l10n'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/sylverant/trunk/ship_server/l10n'
make[1]: Entering directory `/usr/local/sylverant/trunk/ship_server'
gcc -DPACKAGE_NAME=\"ship_server\" -DPACKAGE_TARNAME=\"ship_server\" 
-DPACKAGE_VERSION=\"0.1.0\" -DPACKAGE_STRING=\"ship_server\ 0.1.0\" 
-DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"ship_server\" 
-DVERSION=\"0.1.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 
-DLT_OBJDIR=\".libs/\" -DHAVE_LIBSYLVERANT=1 -DHAVE_LIBMINI18N=1 -DHAVE_ICONV=1 
-DICONV_CONST= -DHAVE_ICONV=1 -DHAVE_PTHREAD=1 -DHAVE_ARPA_INET_H=1 
-DHAVE_INTTYPES_H=1 -DHAVE_NETDB_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 
-DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_STDLIB_H=1 -DHAVE_REALLOC=1 
-DHAVE_GETHOSTNAME=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_INET_NTOA=1 -DHAVE_MEMMOVE=1 
-DHAVE_MEMSET=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRTOUL=1 -I.    
-pthread -I/usr/local/include -I/usr/include/libxml2   -I/usr/include/p11-kit-1 
   -DHAVE_PYTHON -Wall -DSVN_REVISION="\"`svnversion`\"" -MT block.o -MD -MP 
-MF .deps/block.Tpo -c -o block.o `test -f 'src/block.c' || echo 
'./'`src/block.c
In file included from src/block.c:34:0:

src/clients.h:31:20: fatal error: Python.h: No such file or directory

compilation terminated.
make[1]: *** [block.o] Error 1
make[1]: Leaving directory `/usr/local/sylverant/trunk/ship_server'
make: *** [all-recursive] Error 1

What version of the product are you using? On what operating system?

The latest svn pull of sylvanet server (obtained 7/30/2012)
Ubuntu Server 12.04

Please provide any additional information below.
It appears that Python.h is not included in the source.

Original comment by hakugin....@gmail.com on 30 Jul 2012 at 2:15

GoogleCodeExporter commented 9 years ago
Python.h shouldn't be included with Sylverant. It should be installed on your 
system with the Python development package. I probably should make it so the 
default is to disable Python support in ship_server, since it doesn't really do 
anything useful and won't work with Python 3.x.

That all said, Linux still is not supported for running ship_server (See Issue 
#1).

Original comment by bluecrab on 30 Jul 2012 at 2:56

GoogleCodeExporter commented 9 years ago
SVN r652 disables scripting support by default as a workaround for this issue. 
The scripting support needs some serious work before it is sensible to actually 
make it compatible with Python 3.x.

So, for the moment, since there's an acceptable workaround in place, I'm going 
to close this report.

Original comment by bluecrab on 30 Jul 2012 at 3:23

GoogleCodeExporter commented 9 years ago
Thank you bluecrab, I'll grab the newest revision, and to be honest, my 
roommate and I are merely curious about getting a ship going on a Linux server. 
My roommate is a multi-language programmer, I happen to be a tinkerer of sorts 
and we thought we would try to solve the Linux ship issue. Albeit if the 
python.h is part of the Python development package I am surprised that I am 
receiving the error from the compiler saying it is not found. Either way we'll 
take a crack at it and provide you with the results.

Original comment by hakugin....@gmail.com on 30 Jul 2012 at 4:48