[C++-sig] Re: what happened with this std::stringparameterinboost.python

David Abrahams dave at boost-consulting.com
Thu Dec 23 06:30:57 CET 2004


Donnie Leen wrote:
> "David Abrahams" <dave at boost-consulting.com> wrote in message
> news:41CA089D.8080200 at boost-consulting.com...
>> Donnie Leen wrote:
>> > "David Abrahams" <dave at boost-consulting.com> wrote in message
>> > news:cq7dg8$i0o$1 at sea.gmane.org...
>> >> Please post a minimal but *complete* example (that means your program
>> >> should have a main()) and
>>
>> **********************************
>> >> show the exact command lines used to build
>> >> your program and to invoke it.
>> **********************************
>>
>> Thanks, you're partway there.  Could you please supply the missing info?
>> Also, which version of STLPort are you using.
> 
> I build it in win2000+sp4, vc6+sp5, stand template library is stlport
> v4.5.3, link
> with boost.python debug library(boost.python version 1.32.0), python2.4
> I create a "Win32 console Application" (Empty project) in vc6 IDE, add the
> source file and use the default vc6 project setting, compile& link both in
> IDE, not commandline.

Ah.  Well, then there's something wrong with your Visual Studio project
settings.  It works for me here when built with bjam.

====== BEGIN OUTPUT ======
Cout::write	Traceback (most recent call last):
Cout::write	  File "<string>", line 4, in ?
Cout::write	Boost.Python.ArgumentError: Python argument types in
    mym.write(str, str)
did not match C++ signature:
    write(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >)Cout::write	
'import site' failed; use -v for traceback
[3378 refs]

EXIT STATUS: 0
====== END OUTPUT ======

====== BEGIN JAMFILE ========
import python.jam ;
import testing.jam ;

run foo.cpp <dll>@boost/libs/python/build/boost_python
  : # program args
  : # input files
  : # requirements
  $(PYTHON_PROPERTIES)
    <library-path>$(PYTHON_LIB_PATH)
        <find-library>$(PYTHON_EMBEDDED_LIBRARY)
            ;
======== END JAMFILE ==========

You can discover the differences by observing the bjam output with "bjam
-n -a" and comparing that with the command lines generated by the IDE
when it invokes the compiler.

HTH,
-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com




More information about the Cplusplus-sig mailing list