Yes, this is a great tip ... many thanks!
I had to setup the path correctly and add a few more command line
options but hand crafting from the command line appears to work well;
so to summarize it's a three step process with everything explicitly
stated via path or cmd line options:
(1) Append to the system "Path" variable with two new paths; one for
the VS2010 executables and one for it's dependent libraries e.g. on XP
via the "System" properties from the Control Panel:
C:\Program Files\Microsoft Visual Studio 10.0\VC\bin
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE
(2) From your Python sandbox or dev area cmd line, cythonize the pyx
into a cpp file:
cython --cplus RpcClient.pyx
(3) Compile and link the pyd file being very explicit about all the
options e.g. includes, paths and libs:
cl.exe /TpRpcClient.cpp /DWIN32 /I C:\Python27\include /I "C:\Program
Files\Microsoft Visual Studio 10.0\VC\include" /I "C:\Program Files
\Microsoft SDKs\Windows\v7.0A\Include" /I ../rpcHeaders/showIncludes /
link /dll /libpath:C:\Python27\libs /libpath:"C:\Program Files
\Microsoft Visual Studio 10.0\VC\lib" /libpath:"C:\Program Files
\Microsoft SDKs\Windows\v7.0A\Lib" ..\rpcLibs\rpcLib.lib ..\Release
\RpcClient.lib /verbose:lib /out:RpcClient.pyd
I'll continue testing and update if I find any further issues.
On Oct 26, 9:32 pm, 刘振海 <
1989l...@gmail.com> wrote:
> Hi,
> Sorry,I just made a mistake.
> the command line should be like this.
> cython file.pyx
> cl /I path_to_python_include file.c /link /dll /libpath:path_to_python_libs
> /out:file.pyd
>
> Regards,
> Liu Zhenhai
>
> 2011/10/27 刘振海 <
1989l...@gmail.com>
>
>
>
>
>
>
>
> > Hi,
> > When I try to use cython under msvc,I use the command line.
> > cython file.pyx
> > cl /I path_to_python_include file.c /dll /link /libpath:path_to_python_libs
> > /out:file.pyd
>
> > Hope it will help!
>
> > Regards,
> > Liu Zhenhai
>
> > 2011/10/27 Q&A <
qanaple...@gmail.com>