Re: Building the python swig tutorial

2021-03-28 Thread Marco Atzeri via Cygwin

On 28.03.2021 14:22, Brad Bell wrote:
It was unclear from my previous message that I am using the commands 
under the heading

     Building a Python Module
in the tutorial
     http://www.swig.org/tutorial.html
with the exception that python2.7 was changed to python3.8 because that 
is the version of python on my cygwin system.


These commands work fine on my Fedora system (with the proper version of 
python and without any extra libraries specified).




what error ?

The Tutorial needs small adjustments for what I see:


$ swig -python -py3 example.i

$ gcc -c example.c example_wrap.c -I/usr/include/python3.8

$ gcc -shared example.o example_wrap.o -o _example.dll -lpython3.8

$ python
Python 3.8.8 (default, Mar  4 2021, 21:24:42)
[GCC 10.2.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import example
>>> example.fact(5)
120

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Building the python swig tutorial

2021-03-28 Thread Brad Bell

It was unclear from my previous message that I am using the commands under the 
heading
Building a Python Module
in the tutorial
http://www.swig.org/tutorial.html
with the exception that python2.7 was changed to python3.8 because that is the version of python on 
my cygwin system.


These commands work fine on my Fedora system (with the proper version of python and without any 
extra libraries specified).


On 3/27/21 8:09 AM, Hans-Bernhard Bröker wrote:

Am 27.03.2021 um 13:58 schrieb Brad Bell:

It appeard that I need to add an non-standard location to a path so that the linker can find these 
files ?


Read those error messages again.  It's failing to find things _in_ any of those files, which means 
it did in fact find all files it was looking for just fine.


So no, this is almost certainly no issue with locations of files.  It's an issue of not telling the 
linker that it's supposed to be looking for certain libraries in the first place.


But it's virtually impossible to diagnose this sensibly, as you opted not to show any of the actual 
command(s) you used.




--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Building the python swig tutorial

2021-03-27 Thread Marco Atzeri via Cygwin

On 27.03.2021 13:58, Brad Bell wrote:

I am trying to build the swig tutorial on cygwin
http://www.swig.org/tutorial.html 

I changed the version of python to python3.8 (the version on my cygwin 
system) and that solved the include file error.


have you installed the last swig package ?


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Re: Building the python swig tutorial

2021-03-27 Thread Hans-Bernhard Bröker

Am 27.03.2021 um 13:58 schrieb Brad Bell:

It appeard that I need to add an non-standard location to a path so that 
the linker can find these files ?


Read those error messages again.  It's failing to find things _in_ any 
of those files, which means it did in fact find all files it was looking 
for just fine.


So no, this is almost certainly no issue with locations of files.  It's 
an issue of not telling the linker that it's supposed to be looking for 
certain libraries in the first place.


But it's virtually impossible to diagnose this sensibly, as you opted 
not to show any of the actual command(s) you used.


--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple


Building the python swig tutorial

2021-03-27 Thread Brad Bell

I am trying to build the swig tutorial on cygwin
http://www.swig.org/tutorial.html 

I changed the version of python to python3.8 (the version on my cygwin system) and that solved the 
include file error.


Now I am getting the following error during the ld command:

ld: example.o:example.c:(.text+0x54): undefined reference to `time'
example.o:example.c:(.text+0x54): relocation truncated to fit: R_X86_64_PC32 against undefined 
symbol `time'

ld: example.o:example.c:(.text+0x60): undefined reference to `ctime'
example.o:example.c:(.text+0x60): relocation truncated to fit: R_X86_64_PC32 against undefined 
symbol `ctime'


... snip ...

ld: example_wrap.o:example_wrap.c:(.rdata+0x750): undefined reference to 
`PyObject_GenericGetAttr'
ld: example_wrap.o:example_wrap.c:(.rdata+0x8f0): undefined reference to 
`PyObject_GenericGetAttr'
ld: 
example_wrap.o:example_wrap.c:(.rdata$.refptr.PyObject_GenericGetAttr[.refptr.PyObject_GenericGetAttr]+0x0): 
undefined reference to `PyObject_GenericGetAttr'



It appeard that I need to add an non-standard location to a path so that the linker can find these 
files ?


Does someone know where these files are on cygwin ?

--
Problem reports:  https://cygwin.com/problems.html
FAQ:  https://cygwin.com/faq/
Documentation:https://cygwin.com/docs.html
Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple