0

サイロ ライブラリを使用するサンプル コードがいくつかあります。

#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;
}

macports 経由でサイロ ライブラリをインストールしました。サイロ ポートには以下が含まれます。

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 

サンプル コードをコンパイルしようとすると、次のようになります。

g++ functions.cpp /opt/local/lib/libsiloh5.a 

エラーの膨大なリストが表示されます。

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)

これは線と線について続きます...

私は何を間違っていますか?

ありがとう

4

1 に答える 1

1

HDF5 ライブラリにリンクする必要があります。Silo は、PDB、NetCDF、HDF5 などの他の低レベル ストレージ ライブラリの上にあります。

于 2013-08-08T21:19:40.857 に答える