igraph C编译Visual Studio中的链接错误

时间:2014-10-27 01:36:53

标签: c visual-studio igraph

我正在尝试在Visual Studio 2013中编译igraph C代码,已经将所有库都包含在属性中,就像igraph C的分布附带的一些示例一样,但我仍然遇到以下问题输出窗口:

1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_base_graph::~prpack_base_graph(void)" (??1prpack_base_graph@prpack@@QAE@XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_igraph_graph::prpack_igraph_graph(struct igraph_s const *,struct igraph_vector_t const *,int)" (??0prpack_igraph_graph@prpack@@QAE@PBUigraph_s@@PBUigraph_vector_t@@H@Z)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_result::~prpack_result(void)" (??1prpack_result@prpack@@QAE@XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_solver::prpack_solver(class prpack::prpack_base_graph *,bool)" (??0prpack_solver@prpack@@QAE@PAVprpack_base_graph@1@_N@Z)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: __thiscall prpack::prpack_solver::~prpack_solver(void)" (??1prpack_solver@prpack@@QAE@XZ)
1>igraph.lib(prpack.obj) : error LNK2001: unresolved external symbol "public: class prpack::prpack_result * __thiscall prpack::prpack_solver::solve(double,double,double const *,double const *,char const *)" (?solve@prpack_solver@prpack@@QAEPAVprpack_result@2@NNPBN0PBD@Z)
1>C:\Users\Tradeli\Documents\Visual Studio 2013\Projects\igraph C\igraph c\Release\igraph c.exe :   fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

显然这是与prpack相关的东西,但我不知道我需要包含哪个库,有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

这是igraph的MSVC版本中的错误;尝试将/DPRPACK_IGRAPH_SUPPORT=1添加到编译器选项中,并将PRPACK的源文件从src/文件夹(基本上与prpack _ * .cpp匹配的所有内容)添加到项目中的源文件列表中,然后重新编译。