[C++-sig] Re: passing a unicode string from python to c++std::wstring

Roman Yakovenko roman.yakovenko at actimize.com
Mon May 3 08:39:09 CEST 2004


I think that the problem is with wrong selected "runtime library" 
for abc.dll. It should be Multi-threaded (debug) DLL. 
Could you check whether it is your case?

Roman


> -----Original Message-----
> From: David Abrahams [mailto:dave at boost-consulting.com]
> Sent: Saturday, May 01, 2004 8:47 PM
> To: c++-sig at python.org
> Subject: [C++-sig] Re: passing a unicode string from python to
> c++std::wstring
> 
> 
> andrew <acorriga at cs.stevens-tech.edu> writes:
> 
> > As I mentioned in an old thread, this is with MSVC 7,  compiled in
> > release mode, with boost_python.lib
> >
> > It wasn't as simple as just passing a string greater than 7 
> characters
> > that made it crash.  I was using a map in the functions where it
> > crashed.  But you'll see that something that works for a 
> string with 7
> > characters, does not for a string with 8 characters.
> >
> > The simplest test case I could make:
> > http://guinness.cs.stevens-tech.edu/~acorriga/boost/main.cpp
> > http://guinness.cs.stevens-tech.edu/~acorriga/boost/test.py
> >
> > Output:
> > http://guinness.cs.stevens-tech.edu/~acorriga/boost/output.jpg
> >
> > main.cpp compiled into a dll in case it saves you some time:
> > http://guinness.cs.stevens-tech.edu/~acorriga/boost/abc.dll
> >
> > Thanks a lot!
> 
> It must be something about your build; it works perfectly for me:
> 
> bjam -sBUILD=debug-python -sTOOLS=vc7 --verbose-test foo
> ...found 2105 targets...
> ...updating 6 targets...
> vc-C++ 
> c:\build\bin\boost\libs\python\user\foo_ext.pyd\vc7\debug-pyth
> on\foo.obj
> foo.cpp
> vc-Link 
> c:\build\bin\boost\libs\python\user\foo_ext.pyd\vc7\debug-pyth
> on\foo_ext_d.pyd 
> c:\build\bin\boost\libs\python\user\foo_ext.pyd\vc7\debug-pyth
> on\foo_ext.lib
>    Creating library 
> c:\build\bin\boost\libs\python\user\foo_ext.pyd\vc7\debug-pyth
> on\foo_ext.lib and object 
> c:\build\bin\boost\libs\python\user\foo_ext.pyd\vc7\debug-pyth
> on\foo_ext.exp
> execute-test 
> c:\build\bin\boost\libs\python\user\foo.test\vc7\debug-python\foo.run
>         1 file(s) copied.
> ====== BEGIN OUTPUT ======
> it works for 7 chars
> it works for 7 chars
> it works for 7 chars
> it works for 8 chars
> it works for 8 chars
> it works for 8 chars
> [5601 refs]
>    
> EXIT STATUS: 0    
> ====== END OUTPUT ======
> **passed** 
> c:\build\bin\boost\libs\python\user\foo.test\vc7\debug-python\foo.test
> ...updated 6 targets...
> 
> -- 
> Dave Abrahams
> Boost Consulting
> http://www.boost-consulting.com
> 
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 




More information about the Cplusplus-sig mailing list