首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带筒仓库的g++静态链接问题

带筒仓库的g++静态链接问题
EN

Stack Overflow用户
提问于 2013-08-08 19:25:03
回答 1查看 518关注 0票数 0

我有一些使用筒仓库的示例代码:

代码语言:javascript
复制
#include <silo.h>
#include <iostream>
int main(int argc, char *argv[])
{
    DBfile *dbfile = NULL;
        /* Open the Silo file */
    dbfile = DBCreate("basic.silo" , DB_CLOBBER, DB_LOCAL,"Comment about the data", DB_HDF5);

    if(dbfile == NULL)
    {
        return -1;
    }
    /* Add other Silo calls here. */
    /* Close the Silo file. */
    DBClose(dbfile);
    return 0;
}

我通过macport安装了筒仓库。筒仓港口包括:

代码语言:javascript
复制
Port silo contains:
  /opt/local/include/ioperf.h
  /opt/local/include/pmpio.h
  /opt/local/include/silo.h
  /opt/local/include/silo.inc
  /opt/local/lib/libsiloh5.a
  /opt/local/lib/libsiloh5.la
  /opt/local/lib/libsiloh5.settings 

当我尝试用以下方法编译示例代码时:

代码语言:javascript
复制
g++ functions.cpp /opt/local/lib/libsiloh5.a 

我得到了一大串错误:

代码语言:javascript
复制
Undefined symbols for architecture x86_64:
  "_H5Aclose", referenced from:
      _db_hdf5_Open in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_Create in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_GetObject in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_InqVarType in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_InqMeshName in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_GetCurve in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_GetCsgmesh in libsiloh5.a(silo_hdf5.o)
      ...
  "_H5Acreate1", referenced from:
      _db_hdf5_Create in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_hdrwr in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_compname in libsiloh5.a(silo_hdf5.o)
  "_H5Aget_type", referenced from:
      _db_hdf5_GetObject in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_GetComponentStuff in libsiloh5.a(silo_hdf5.o)
      _db_hdf5_get_comp_var in libsiloh5.a(silo_hdf5.o)
      _copy_dir in libsiloh5.a(silo_hdf5.o)

这条线还在继续。

我做错了什么?

谢谢

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-08 21:19:40

您需要在HDF5库中链接。筒仓位于其他低级存储库之上,如PDB、NetCDF和HDF5。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18134397

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档