3
我使用SWIG來翹曲一個非常簡單的C++類。 boost ptime用於該C++類。SWIG錯誤升壓:: posix_time :: ptime轉換
當我嘗試執行命令
swig -c++ -python example.i
有一個錯誤:
example.h:7: Warning 315: Nothing known about 'boost::posix_time::ptime'.
example.h:7: Warning 315: Nothing known about 'boost::posix_time::ptime'.
我怎樣才能解決這個問題呢?
的example.i文件是:
//File: example.i
%module example
%{
#define SWIG_FILE_WITH_INIT
#include <boost/date_time/posix_time/ptime.hpp>
#include "example.h"
%}
// for std:string
%include "std_string.i"
// for vector
%include "std_vector.i"
%include stl.i
%include "example.h"
的example.h文件的文件是:
#pragma once
#include <string>
#include <boost/date_time/posix_time/ptime.hpp>
using std::string;
using boost::posix_time::ptime;
class Example{
public:
Example(string name, ptime timestamp){
// doSomething...
}
};