igraph C compiling link errors in Visual Studio

2019-07-23 10:46发布

I'm trying to compile an igraph C code in the Visual Studio 2013, already got all libraries included in the properties, just as some examples that come with the distribution of igraph C, but i still got the following problems in the output window:

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 ==========

Obviously it's something related to the prpack, but i have no clue of which library do i need to include, does anyone knows how to solve this?

1条回答
来,给爷笑一个
2楼-- · 2019-07-23 11:47

This is a bug in the MSVC release of igraph; try adding /DPRPACK_IGRAPH_SUPPORT=1 to the compiler options and also add PRPACK's source files from the src/ folder (basically everything that matches prpack_*.cpp) to the list of source files in the project, then recompile.

查看更多
登录 后发表回答