Mapbox GL分段错误

时间:2015-08-10 11:22:07

标签: c++ segmentation-fault stdstring mapbox-gl

我使用mapbox-gl-native(https://github.com/mapbox/mapbox-gl-native)。

我上课了,例如:

class MapboxGL {
public:
 explicit MapboxGL();
 ~MapboxGL();
}

在构造函数MapboxGL()中,我尝试创建一个对象并设置访问令牌:

mbgl::DefaultFileSource *fileS = new mbgl::DefaultFIleSource(nullptr);
fileS->setAccessToken("my token");

但在fileS->setAccessToken(..)之后我有错误:

Segmentation fault in mbgl::DefaultFileSource::setAccessToken(..)

调用堆栈:函数:std::string::assign(std::string const&)()

mbgl :: DefaultFileSource方法:

void mbgl::DefaultFileSource::setAccessToken(const std::string& t) { accessToken = t; } 

有什么问题?

0 个答案:

没有答案