469,609 Members | 1,682 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,609 developers. It's quick & easy.

Problem with custom build with MSVC8

Hello, and thank you for the time,

I'm currently in a project where I need to support 2 versions of the same program.
One version (the current one) uses Python 1.5.2, the new version, which I'm currently building, must use Python 2.5.

To ensure maximum compatibility between the 2 versions, I want to change import.c of Python 2.5. And I want to make a static library (so that no end user can accidently replace the lib).

But before I do that, I want to do a test build (of Python) to see if it builds correctly.
Here is where I hit the problem.

I've looked through pyconfig.h and saw that I needed to define Py_NO_ENABLE_SHARED to disable dynamic linking (which I did).

But I'm having some problems with actually building it.
I don't need MSI or SQLite (so I've unloaded them).
But for some reason I can't seem to get it compiled (not even out of the box).

I'm using Microsoft Visual Studio 2005 Profesional, on a Windows XP Pro box.

To rephrase it, I want to compile Python 2.5 as a static library without MSI and sqlite.

If I can get it compiled, then it's a small step to edit import.c for my needs.

Thank you for your time,

Sep 29 '06 #1
4 1474
I'm sorry for the bump, but if there is something unclear, please let me know, and I'll be able to clarify it some more.
Oct 11 '06 #2
6,596 Expert 4TB
Sounds like you are complicating your life. Why not just compile you program as a module and import it. I use SWIG on xp. It comes with sample projects for VS.
Oct 11 '06 #3
I didn't design the original program. I just need to make sure I can use the original scripts without overwriting all old pyc files.
There is a PEP that could be usefull here, but I'd like to simply append 25 at the end of the pyc.

I just need a static library (think I can do that easily) without the sqlite and msi baked into it.
I think I've made the needed changes to import.c to make my original intentions work.

Actually, the pyc25 is optional, but the static linking is required.

Am I wrong to think that the pythoncore project in the PCBuild8 generates the dll?
Oct 13 '06 #4
6,596 Expert 4TB
Because I have never tried to compile python itself, I don't know about PCBuild8.
I am almost certain that any library, whether for import or static, must be compiled with the correct version of python.h and python.lib. You don't need the original source code, but you do need the header and .lib files for your extension.
Oct 14 '06 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Jose Vicente Nunez Z | last post: by
2 posts views Thread by Helmut Jarausch | last post: by
7 posts views Thread by Mr. Mountain | last post: by
2 posts views Thread by Peter Ritchie | last post: by
7 posts views Thread by Dino Buljubasic | last post: by
reply views Thread by Michael Russell | last post: by
1 post views Thread by Michael Russell | last post: by
reply views Thread by Solution2021 | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.