Expression: is_block_type_valid(header->block_use)

 

VS2015 openmesh read_mesh 读取网格时,这样一段代码

void CPathFace::test2()
{
    string file = ".\\data\\face\\face_forehead.obj";
    MyMesh mesh;
    if (!OpenMesh::IO::read_mesh(mesh, file))
    {
        std::cerr << "Cannot open mesh to file" << std::endl;
        exit(1);
    }
}

release模式下没问题。

debug 模式下,报 Debug Assertion Failed! Expression: is_block_type_valid(header->block_use)

具体如下错误:

image

 

但如果将mesh定义为MyMesh指针类型,即

void CPathFace::test2()
{
    string file = ".\\data\\face\\face_forehead.obj";
    MyMesh *mesh = new MyMesh;
    if (!OpenMesh::IO::read_mesh(*mesh, file))
    {
        std::cerr << "Cannot open mesh to file" << std::endl;
        exit(1);
    }
}

则debug和release模式下都没问题。

 

bug算是解决了,但具体原因还是没搞清。

posted @ 2016-08-06 11:20  VVingerfly  阅读(2569)  评论(0编辑  收藏  举报