1

I am new to C++ and SWIG. This is my first project.

I am able to successfully build my Python extension using distutils. However, when I try my object, I keep getting this error.

It seems that there is a conversion problem from getting the python string and transforming it into a std::string.

I am working on Windows 7, using Visual Studio C++ 2008 Express

Here is my swig interface file

/* swig interface file */
%module Geodatabase 
%{
#include Geodatabase_helper.h
%}
namespace FileGeodatabase {
  class Geodatabase {
    public:
  Geodatabase();
  Geodatabase(std::string p);
  ~Geodatabase();
  void Open(std::string p);
  void Close();
   };
}
Hugo Estrada
  • 607
  • 1
  • 8
  • 18

1 Answers1

4

According to the swig documentation, using std::string requires %include "std_string.i".

%module example
%include "std_string.i"

std::string foo();
void        bar(const std::string &x);
Robᵩ
  • 163,533
  • 20
  • 239
  • 308