Re: [Python-Dev] Python + Visual C++ 8.0?
On Tuesday, December 27, 2005 Ralf W. Grosse-Kunstleve wrote:
Sorry, the manifests are new to me. How can I check if the manifest is correctly embedded? FWIW: I already tried copying the manifest into the directory with the extensions.
To check if you have a manifest you need to use a tool like "Resource Hacker" or "XN Resource Editor". http://www.wilsonc.demon.co.uk/d10resourceeditor.htm Where did you get that manifest? You need one listing the MSVC runtime (not one which enables the XP look). Of course, it must be named exactly like you dll/pyd, with an additional .manifest extension. <?xml version='1.0' encoding='UTF-8' standalone='yes'?> <assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'> <dependency> <dependentAssembly> <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' /> </dependentAssembly> </dependency> </assembly>
In case it matters, here are the compiler and liker switches I am using (commands issued by scons):
cl /nologo /D_CRT_SECURE_NO_DEPRECATE /wd4996 /Zm800 /MD /GR /EHsc /DBOOST_DISABLE_THREADS /DNDEBUG /Ox -DBOOST_PYTHON_MAX_BASES=2 -DBOOST_PYTHON_SOURCE
link /nologo /incremental:no /dll /out:lib\cctbx_math_ext.pyd /implib:lib\cctbx_math_ext.lib /LIBPATH:lib
Am I missing some magic new switch?
Add /manifest to the linker options. This will generate cctbx_math_ext.pyd.manifest either in the output folder or in the intermediate one. Then you need to run mt.exe to embedd the manifest: mt.exe /outputresource:"cctbx_math_ext.pyd;#2" /manifest cctbx_math_ext.pyd.manifest
--- Adal Chiriliuc <adal.chiriliuc@gmail.com> wrote:
Then you need to run mt.exe to embedd the manifest: mt.exe /outputresource:"cctbx_math_ext.pyd;#2" /manifest cctbx_math_ext.pyd.manifest
That is the magic trick! After applying the mt command to all our extensions most of our unit tests work even with the VC7.1 compiled Python. I am very optimistic I can get all our tests to work with a few C++ adjustments (related to the new way STL iterators are implemented). Thanks a lot! I could not have figured this out myself in a million years. Cheers, Ralf __________________________________ Yahoo! for Good - Make a difference this year. http://brand.yahoo.com/cybergivingweek2005/
participants (2)
-
Adal Chiriliuc
-
Ralf W. Grosse-Kunstleve