By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

Problem with custom build with MSVC8

P: 3
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,

MLeo
Sep 29 '06 #1
Share this Question
Share on Google+
4 Replies


P: 3
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

bartonc
Expert 5K+
P: 6,596
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

P: 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

bartonc
Expert 5K+
P: 6,596
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.