igraph C在Visual Studio中编译链接错误 [英] igraph C compiling link errors in Visual Studio
问题描述
我正在尝试在Visual Studio 2013中编译igraph C代码,已经将所有库包含在属性中,就像igraph C发行版附带的一些示例一样,但是在输出窗口:
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 ==========
很明显,这与prpack有关,但是我不知道我需要包括哪个库,有人知道如何解决这个问题吗?
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?
推荐答案
这是igraph的MSVC版本中的错误;尝试将/DPRPACK_IGRAPH_SUPPORT=1
添加到编译器选项中,然后还将src/
文件夹中的PRPACK的源文件(基本上与prpack _ *.cpp匹配的所有内容)添加到项目中的源文件列表中,然后重新编译.
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.
这篇关于igraph C在Visual Studio中编译链接错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!