[C++-sig] Boost.Python and STLPort, ArgumentError

Simon Pickles sipickles at googlemail.com
Fri Jun 19 09:30:37 CEST 2009


Hello,

Configuration:
WinXP SP3
MSVC8
Python 2.5.4
Boost 1.38
STLPort 5.2
Bullet Physics (requires STLPort to avoid Alignment problems)

I need to use STLPort with my c++ extension modules, due to Bullet 
Physics API.

I've managed to build STLPort, rebuilt boost (bjam stllib=stlport 
stage), and rebuild my project (bjam define=__STL_DEBUG). My problem 
starts when I run my python code. This calls c++ modules, and I get a 
type mismatch:

E:\WorkingCopies\client\extended>python client.py
Traceback (most recent call last):
  File "client.py", line 232, in <module>
    log.StartLogToFile("Log_Client.txt")
Boost.Python.ArgumentError: Python argument types in
    None.None(Logger, str)
did not match C++ signature:
    None(class Logger {lvalue}, class stlpd_std::basic_string<char,class 
stlpd_std::char_traits<char>,class stlpd_std::allocator<char> >)

Clearly, the c++ module, built with stlport, is expecting an 
stlp::string while the calling python code is providing a std::string 
(eg a python string)

Please don't tell me I have to rebuild python using stlport? I have not 
had much success building python from source in the past! :)

Is there a simpler remedy for this hopefully small hurdle?

Thank you for your help

Simon



More information about the Cplusplus-sig mailing list