boost::read_graphml visual studio 2013
boost::read_graphml visual studio 2013
boost库工作正常,除了这个函数boost::read_graphml()它说有问题
#include <iostream>
#include <iostream>
#include <string>
#include <fstream>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/graphml.hpp>
int main()
{
using namespace boost;
typedef adjacency_list<vecS, vecS, undirectedS, no_property > Graph;
typedef dynamic_properties Dproperty;
Graph g;
Dproperty dp;
std::string file = "test.graphml";
std::ifstream t(file.c_str());
if (!t.is_open())
{
std::cout << "loading file failed." << std::endl;
throw "Could not load file.";
}
read_graphml(t, g, dp);
return 0;
}
错误是:
error LNK2019: unresolved external symbol "void __cdecl boost::read_graphml(class std::basic_istream<char,struct std::char_traits<char> > &,class boost::mutate_graph &,unsigned int)" (?read_graphml@boost@@YAXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAVmutate_graph@1@I@Z) referenced in function "void __cdecl boost::read_graphml<class boost::adjacency_list<struct boost::vecS,struct boost::vecS,struct boost::directedS,struct boost::property<enum boost::vertex_name_t,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::no_property>,struct boost::no_property,struct boost::no_property,struct boost::listS> >(class std::basic_istream<char,struct std::char_traits<char> > &,class boost::adjacency_list<struct boost::vecS,struct boost::vecS,struct boost::directedS,struct boost::property<enum boost::vertex_name_t,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,struct boost::no_property>,struct boost::no_property,struct boost::no_property,struct boost::listS> &,struct boost::dynamic_properties &,unsigned int)" (??$read_graphml@V?$adjacency_list@UvecS@boost@@U12@UdirectedS@2@U?$property@W4vertex_name_t@boost@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uno_property@2@@2@Uno_property@2@U52@UlistS@2@@boost@@@boost@@YAXAAV?$basic_istream@DU?$char_traits@D@std@@@std@@AAV?$adjacency_list@UvecS@boost@@U12@UdirectedS@2@U?$property@W4vertex_name_t@boost@@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@Uno_property@2@@2@Uno_property@2@U52@UlistS@2@@0@AAUdynamic_properties@0@I@Z)
1>D:_example.exe : fatal error LNK1120: 1 unresolved externals
您需要
- 链接到已编译的Boost Graph库或
- 将CCD_ 1包括到构建中
另请参阅:什么是未定义的引用/未解决的外部符号错误,以及如何修复?
相关文章:
- 将"libpqxx"与Visual Studio 2013链接/安装,以便与PostgrSQL建立C++连接
- Visual Studio 2013,错误 MSB8020:找不到 Visual Studio 2010 的生成工具
- 为什么在Visual Studio 2013上的std::this_thread::sleep_for上死锁
- 性能报告 (.vspx) 在 Visual Studio 2013 中未打开(显示损坏)
- 在 Visual Studio 2013 中使用零大小数组C++
- Visual Studio 2013 标头包含失败
- Visual studio 2013 和 g++ 7.1 中将 int 和 long 类型相乘时的 c++ 差异行为
- 在Visual Studio 2013中编译的STL列表代码在Visual Studio 2019中给出了错误.想知道原
- 错误 LNK2019: 未解析的外部符号 Visual Studio 2013 与 openCV
- cv:内存位置的异常 - 运行 openCV 代码 Visual Studio 2013 & Visual Studio 2017 - Windows 7
- 模块计算机类型和目标计算机类型 Visual Studio 2013
- 如何在Visual Studio 2013 Ultimate Edition中包含某个单词的每一行中插入断点
- 具有显式参数和大小的可变参数模板.Visual Studio 2013.
- 使用 Visual Studio 2013 编译 GDCM dlls 2.8.4 for Windows
- 基本字符串操作有问题 [c++, Visual Studio 2013]
- Visual Studio 2013中可能的C/C 编译器错误
- 在Visual Studio 2013上.Win32 应用和 CLR 应用
- 我正在尝试在Visual Studio 2013中编写我的第一个"Hello World"代码。为什么我会收到"IntelliSense: no operator message"和"error C2
- DLL不导出Visual Studio 2013 VB代码中的字符串
- 我们如何使用Visual Studio 2013访问C 中的更改编号