"unresolved externals" error message building pywin32 for pypy

2013-06-25 Thread jasonveldicott
Hi,

I get an "unresolved externals" error message when building pywin32 for pypy, 
as listed below.  Both are the latest versions, 
amauryfa-pywin32-pypy-2a1da51e8152 and pypy-2.0.2.  As per build requirements, 
VS2012 and Win 7 SDD are installed.

Not sure what the error msg indicates, but maybe the python lib in linking is 
missing some required functions.

Possible cause of error may be a python installation on the same system (build 
could be using python lib instead of pypy lib), but python has been removed 
from path, and its folder name has also been changed.

Any suggestions as to cause of this error would be appreciated.

Thanks

Jason


H:> pypy setup.py install

Building pywin32 2.7.217.1
running install
running build
running build_py
running build_ext
Found version 0x601 in H:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\include\SDKDDKVER.H
building 'pywintypes' extension
...

H:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\BIN\link.exe /DLL 
/nologo /INCREMENTAL:NO /LIBPATH:H:\pypy-2.0.2\include 
/LIBPATH:build\temp.win32-2.7\Release /LIBPATH:H:\Program Files (x86)\Microsoft 
SDKs\Windows\v7.0A\lib advapi32.lib user32.lib ole32.lib oleaut32.lib 
/EXPORT:initpywintypes build\temp.win32-2.7\Release\win32\src\PyACL.obj 
build\temp.win32-2.7\Release\win32\src\PyDEVMODE.obj 
build\temp.win32-2.7\Release\win32\src\PyHANDLE.obj 
build\temp.win32-2.7\Release\win32\src\PyIID.obj 
build\temp.win32-2.7\Release\win32\src\PyLARGE_INTEGER.obj 
build\temp.win32-2.7\Release\win32\src\PyOVERLAPPED.obj 
build\temp.win32-2.7\Release\win32\src\PySECURITY_ATTRIBUTES.obj 
build\temp.win32-2.7\Release\win32\src\PySECURITY_DESCRIPTOR.obj 
build\temp.win32-2.7\Release\win32\src\PySID.obj 
build\temp.win32-2.7\Release\win32\src\PyTime.obj 
build\temp.win32-2.7\Release\win32\src\PyUnicode.obj 
build\temp.win32-2.7\Release\win32\src\PyWAVEFORMATEX.obj 
build\temp.win32-2.7\Release\win32\src\
 PyWinTypesmodule.obj 
/OUT:build\lib.win32-2.7\pywin32_system32\pywintypes27.dll 
/IMPLIB:build\temp.win32-2.7\Release\win32\src\pywintypes27.lib /MANIFEST 
/MANIFEST:NO /MACHINE:x86 /BASE:0x1e7a /DEBUG 
/PDB:build\temp.win32-2.7\Release\pywintypes.pdb

Creating library build\temp.win32-2.7\Release\win32\src\pywintypes27.lib and 
object build\temp.win32-2.7\Release\win32\src\pywintypes27.exp

PyTime.obj : error LNK2001: unresolved external symbol _PyArg_ParseTuple
PyWAVEFORMATEX.obj : error LNK2001: unresolved external symbol _PyArg_ParseTuple

PyWinTypesmodule.obj : error LNK2019: unresolved external symbol 
_PyArg_ParseTuple referenced in function "int __cdecl 
PyWinGlobals_Ensure(void)" (?PyWinGlobals_Ensure@@YAHXZ)

PyOVERLAPPED.obj : error LNK2001: unresolved external symbol _PyArg_ParseTuple

PySECURITY_ATTRIBUTES.obj : error LNK2001: unresolved external symbol 
_PyArg_ParseTuple

PySECURITY_DESCRIPTOR.obj : error LNK2001: unresolved external symbol 
_PyArg_ParseTuple

...

build\lib.win32-2.7\pywin32_system32\pywintypes27.dll : fatal error LNK1120: 
106 unresolved externals

error: command 'H:\Program Files (x86)\Microsoft Visual Studio 
11.0\VC\BIN\link.exe' failed with exit status 1120
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Calling Java jar class with parameter from Python

2012-07-21 Thread jasonveldicott
On Saturday, July 21, 2012 5:20:48 AM UTC-7, Peter Otten wrote:
> Jason Veldicott wrote:
> 
> > subprocess.Popen(["C:\\Program Files
> > (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe", "-cp
> > c:\\antlr\\antlr-3.4-complete.jar org.antlr.Tool",
> > "C:\\Users\\Jason\\Documents\\antlr\\java grammar\\Java.g"],
> > stdout=subprocess.PIPE, shell=True ).communicate()
> > 
> > 
> > Obviously, some trick is being missed.  Could anyone shed light on what 
> it
> > may be?
> 
> File names with spaces can be tricky. Try thoroughly separating the 
> individual arguments and let subprocess do the necessary escaping. 
> I think it should be
> 
> subprocess.Popen([
>   "C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe",
>   "-cp",
>   "C:\\antlr\\antlr-3.4-complete.jar",
>   "org.antlr.Tool",
>   "C:\\Users\\Jason\\Documents\\antlr\\java grammar\\Java.g"],
>stdout=subprocess.PIPE).communicate()

That did the trick, thanks.  

I had the impression from another post that the breaking up of command strings 
into subprocess arguments could be done arbitrarily as needed to deal with 
nested inverted commas.  Obviously as you've shown, this is not the case, at 
least for Popen.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Calling Java jar class with parameter from Python

2012-07-21 Thread jasonveldicott
On Saturday, July 21, 2012 6:57:48 AM UTC-7, Roy Smith wrote:
> In article ,
>  Peter Otten <__pete...@web.de> wrote:
> 
> > subprocess.Popen([
> >   "C:\\Program Files (x86)\\Java\\jdk1.7.0_05\\bin\\java.exe",
> >   "-cp",
> >   "C:\\antlr\\antlr-3.4-complete.jar",
> >   "org.antlr.Tool",
> >   "C:\\Users\\Jason\\Documents\\antlr\\java grammar\\Java.g"],
> >stdout=subprocess.PIPE).communicate()
> 
> You might also want to try raw strings.  This should be identical to 
> Peter's version, but easier to read:
> 
> subprocess.Popen([
>   r"C:\Program Files (x86)\Java\jdk1.7.0_05\bin\java.exe",
>   r"-cp",
>   r"C:\antlr\antlr-3.4-complete.jar",
>   r"org.antlr.Tool",
>   r"C:\Users\Jason\Documents\antlr\java grammar\Java.g"],
>stdout=subprocess.PIPE).communicate()
> 
> although I would probably refactor it like:
> 
> args = [r"C:\Program Files (x86)\Java\jdk1.7.0_05\bin\java.exe",
> r"-cp",
> r"C:\antlr\antlr-3.4-complete.jar",
> r"org.antlr.Tool",
> r"C:\Users\Jason\Documents\antlr\java grammar\Java.g",
>]
> proc = subprocess.Popen(args, stdout=subprocess.PIPE)
> proc.communicate()

The r string notation at least saves having to double type a bunch of 
backslashes, although the appearance prepended to the string takes a little 
getting used to.

Visually the separate array to handle arguments is perhaps cleaner, having more 
resemblance to the original command.

Thanks for the tips.
-- 
http://mail.python.org/mailman/listinfo/python-list