我有一些使用 silo 库的示例代码:
#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 安装了 silo 库。筒仓端口包含:
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)
这继续为线条和线条......
我究竟做错了什么?
谢谢