[PyKDE] sip undefined type

jim jlh at yvn.com
Wed Feb 16 07:33:21 GMT 2005


I am trying to wrap the xbase c++ library so I can handle ca clipper xbase 
files from python.  (If anyone out there has a better suggestion I am all 

When I try to run sip against my wrapper class I get an error similar to the 
following (different type, same error)

sip -c . pytest.sip
sip: std::string is undefined

This actual error is from running the following sip file, against the 
following c++ code.

I have written a small test class, a rather crude stack in c++ and was able to 
wrap it with sip.  When I added a string variable, it died with the above 

%Module pytest 0

class Stack

#include "test4.h"

  std::string foo;
  void push(const int);
  int pop();


#include <string>

class Stack
  int count;
  int data[100];

  std::string foo;
  void push(const int item);
  int pop();



#include "test4.h"

  count = 0;

void Stack::push(const int item)
  data[count] = item;


int Stack::pop()
  return data[count];

This code compiles and links just fine in c++
I can create a lib file and call it from a c++ program.
If I remove the string foo; line, I can sip it and use it from python.

I am an excelent programmer in clipper, a passable programer in python and an 
amature in c++.

I would be more than glad to rtfm if I had a hint about which fm and where to 
look.  I have looked thru the last 6 months or so of the mailing list 
archives without any hints.

It would seem as if there is something I am missing somewhere, simple and 
obvious that I am looking past.

Thanks in advance,
Jim Hurlburt
Yakima, WA.

More information about the PyQt mailing list