Re: VC++ linking problem

2005-07-08 Thread Miki Tebeka
Hello J,

> I will put a hold on compiling the latest version until I really have to.
> I will probably switch to VC 7 before that.
You can use the (free) MinGW  compiler (www.mingw.org). It can build
extension that link to Python 2.4.
Just use distutils setup.py and run 'python setup.py build_ext -c mingw32'

HTH.
--

Miki Tebeka <[EMAIL PROTECTED]>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys


pgp2AzDhXSn5B.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: VC++ linking problem

2005-07-07 Thread J
Thank you very much Miki!

That was an easy solution. It links... I will put a hold on compiling
the latest version until I really have to. I will probably switch to VC
7 before that.

Cheers
Jochen


Miki Tebeka wrote:
> Hello Jochen,
>
> > I started embedding python into a 3D graphics App and I came
> > across this linking problem.
> >
> >
> > SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol
> > __imp__Py_InitModule4TraceRefs
> > SO.lib(ScnNode.obj) : error LNK2001: unresolved external symbol
> > __imp___Py_RefTotal
> > SO.lib(ScnLight.obj) : error LNK2001: unresolved external symbol
> > __imp___Py_RefTotal
> >
> > I am linking against python24.lib using VC++ 6.0. Before I got to this
> > point it couldn't find python24_d.lib. After searching around
> > for a while I came across a solution that included changing
> > python24_d.lib to python24.lib in one of the header files. I hope that
> > didn't have a negative effect. I would really appreciate
> > some help
> This is since Python header file is in debug mode and you link with the
> regular library.
>
> Just do:
> #undef _DEBUG /* Link with python24.lib and not python24_d.lib */
> #include 
>
> and you'll be fine.
>
> IMO python should try and link with python24.lib when compiling in debug
> mode since we want to debug our program and not Python.
>
> Bye.
> --
> 
> Miki Tebeka <[EMAIL PROTECTED]>
> http://tebeka.bizhat.com
> The only difference between children and adults is the price of the toys

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: VC++ linking problem

2005-07-07 Thread Wolfgang Langner
Hello Jochen,

> I started embedding python into a 3D graphics App and I came
> across this linking problem.
> 
> 
> SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol
> __imp__Py_InitModule4TraceRefs
> SO.lib(ScnNode.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> SO.lib(ScnLight.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> 
> I am linking against python24.lib using VC++ 6.0. Before I got to this
> point it couldn't find python24_d.lib. After searching around
> for a while I came across a solution that included changing
> python24_d.lib to python24.lib in one of the header files. I hope that
> didn't have a negative effect. I would really appreciate
> some help

Be careful, python 2.4 is build with VC++ 7.1.
Mixing this in your application which is build with
VC++ 6.0 can lead to trouble.

python24_d.lib is the debug version of the python library.
It's possible to build your application in debug against a
release Python Version. But I don't know what switches are needed.

This unresolved external symbols are a result of your linkage.
This symbols are only present in the debug version of the library.
If you start python_d.exe (debug executable of python) you get
the total ref count after every statement.

To fix this, build debug version of your App against debug version
of python or set all switches to build a debug version against release
python.
The boost python library does this, see:
http://www.boost.org/libs/python/doc/index.html


bye by Wolfgang
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: VC++ linking problem

2005-07-07 Thread Miki Tebeka
Hello Jochen,

> I started embedding python into a 3D graphics App and I came
> across this linking problem.
> 
> 
> SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol
> __imp__Py_InitModule4TraceRefs
> SO.lib(ScnNode.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> SO.lib(ScnLight.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> 
> I am linking against python24.lib using VC++ 6.0. Before I got to this
> point it couldn't find python24_d.lib. After searching around
> for a while I came across a solution that included changing
> python24_d.lib to python24.lib in one of the header files. I hope that
> didn't have a negative effect. I would really appreciate
> some help
This is since Python header file is in debug mode and you link with the
regular library.

Just do:
#undef _DEBUG /* Link with python24.lib and not python24_d.lib */
#include 

and you'll be fine.

IMO python should try and link with python24.lib when compiling in debug
mode since we want to debug our program and not Python.

Bye.
--

Miki Tebeka <[EMAIL PROTECTED]>
http://tebeka.bizhat.com
The only difference between children and adults is the price of the toys


pgps6D8NhH5ez.pgp
Description: PGP signature
-- 
http://mail.python.org/mailman/listinfo/python-list

Re: VC++ linking problem

2005-07-07 Thread Gerhard Haering
On Thu, Jul 07, 2005 at 04:52:11AM -0700, J wrote:
> Hi everyone,
> 
> I started embedding python into a 3D graphics App and I came
> across this linking problem.
> 
> 
> SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol
> __imp__Py_InitModule4TraceRefs
> SO.lib(ScnNode.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> SO.lib(ScnLight.obj) : error LNK2001: unresolved external symbol
> __imp___Py_RefTotal
> 
> I am linking against python24.lib using VC++ 6.0. Before I got to this
> point it couldn't find python24_d.lib. After searching around
> for a while I came across a solution that included changing
> python24_d.lib to python24.lib in one of the header files. I hope that
> didn't have a negative effect. I would really appreciate
> some help

It *does* have a negative effect. Python debug and non-debug libraries
are not binary compatible, even when otherwise compiled with the same
settings. I think that's the reason for the _d suffixes for Python debug
binaries on Windows.

The solution for you is to compile yourself a debug version of Python
for testing your whole app in debug mode.

AFAIR in python-dev Python 2.4 can still be compiled with MSVC6, even
though the official binaries are built with MSVC 7.1.

-- Gerhard
-- 
Gerhard Häring - [EMAIL PROTECTED] - Python, web & database development


signature.asc
Description: Digital signature
-- 
http://mail.python.org/mailman/listinfo/python-list