ask help for problem with static linking (fwd)

Xiaohong Yuan xhyuan at oe.fau.edu
Sat Jun 5 02:13:29 EDT 1999


On Fri, 4 Jun 1999, Gordon McMillan wrote:

> Xiaohong Yuan wrote:
>
> > I am trying to link my c extension module staticly with python
> > interpreter. But in my c extension module, I have external variable
> > declaration, which makes it fail to be linked with Python
> > interpreter. There must be some way to solve this, could anybody
> > help me with this?
>
> Please forgive the lack of response to your query, but I think people
> are confused about what you are asking.
>
> A variable declared as "extern" will have to be found in some object
> when you link. Is this variable something you expected the Python
> interpreter to expose? If so, what is it? What version of Python?
> What platform? What compiler?
>
> - Gordon
>

I am sorry I didn't make it clear. In my C extension module, I declare
some extern variables. Those extern variables are for my own application.
They can not be found in Python interpreter source code. So when I do
static linking, my c extension module fails to be linked with the python
interpreter. I don't want to add into Python source code the definition of
my extern variables. There might be some way to wrap my c extensions such
that extern variables would not cause a problem. My platform is QNX, my
compiler is watcom compiler. I don't think platform and compiler matter,
the problem might be how should I deal with extern variable when writing
python c extensions.

--Xiaohong Yuan





More information about the Python-list mailing list