gpt4 book ai didi

c++ - 无法安装 Stanford C++ 库(图形、BasicGraph 类)

转载 作者:太空宇宙 更新时间:2023-11-04 12:38:56 27 4
gpt4 key购买 nike

<分区>

我在安装 Stanford C++ 库时遇到问题,尤其是我需要用于项目的 Graph 相关库。我使用的是 Visual Studio IDE、Eclipse IDE,因此非常感谢针对其中任何一个量身定制的说明。

我已经做了以下事情:

-> 在 https://stanford.edu/~stepp/cppdoc/ 下载并解压库

-> 选择 StanfordCPPLib 中的“collections”文件夹作为 Eclipse/Visual Studio 的#include 目录

-> 事情似乎在这一点之前有效,#include 有效。但是在编译期间,会出现大量其他“ Unresolved inclusion ”。

请真正安装过该库/愿意安装该库的人帮助我做同样的事情。我花了很多时间自己解决这个问题,这是一个主要瓶颈。

规范:Windows 10 家庭版我的代码:

     #include "pch.h"
#include <iostream>
#include <collections/basicgraph.h>

using namespace std;
int main() {
BasicGraph g;
g.addVertex("1");
g.addVertex("2");
g.addEdge("1", "2");
cout<< g.getVertex("1")->name <<endl;
//boost::optional<int>;
return 0;
}

结果:

1>------ Build started: Project: IsolationBranchingImplementation, Configuration: Debug Win32 ------
1>main.cpp
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl stanfordcpplib::staticInitializeLibrary(void)" (?staticInitializeLibrary@stanfordcpplib@@YAXXZ) referenced in function "public: __thiscall stanfordcpplib::StanfordCppLibraryInitializer::StanfordCppLibraryInitializer(void)" (??0StanfordCppLibraryInitializer@stanfordcpplib@@QAE@XZ)
1>main.obj : error LNK2019: unresolved external symbol "void __cdecl error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?error@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: void __thiscall Vector<struct Map<class EdgeGen<void *,void *> *,bool>::iterator::NodeMarker>::checkIndex(int,int,int,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)const " (?checkIndex@?$Vector@UNodeMarker@iterator@?$Map@PAV?$EdgeGen@PAXPAX@@_N@@@@ABEXHHHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "double __cdecl stringToReal(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?stringToReal@@YANABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __thiscall BasicGraphGen<void *,void *>::scanArcData(class TokenScanner &,class EdgeGen<void *,void *> *,class EdgeGen<void *,void *> *)" (?scanArcData@?$BasicGraphGen@PAXPAX@@UAEXAAVTokenScanner@@PAV?$EdgeGen@PAXPAX@@1@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall TokenScanner::getStringValue(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?getStringValue@TokenScanner@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV23@@Z) referenced in function "private: class VertexGen<void *,void *> * __thiscall Graph<class VertexGen<void *,void *>,class EdgeGen<void *,void *> >::scanNode(class TokenScanner &)" (?scanNode@?$Graph@V?$VertexGen@PAXPAX@@V?$EdgeGen@PAXPAX@@@@AAEPAV?$VertexGen@PAXPAX@@AAVTokenScanner@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: enum TokenScanner::TokenType __thiscall TokenScanner::getTokenType(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?getTokenType@TokenScanner@@QBE?AW4TokenType@1@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "private: class VertexGen<void *,void *> * __thiscall Graph<class VertexGen<void *,void *>,class EdgeGen<void *,void *> >::scanNode(class TokenScanner &)" (?scanNode@?$Graph@V?$VertexGen@PAXPAX@@V?$EdgeGen@PAXPAX@@@@AAEPAV?$VertexGen@PAXPAX@@AAVTokenScanner@@@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall TokenScanner::nextToken(void)" (?nextToken@TokenScanner@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: virtual void __thiscall BasicGraphGen<void *,void *>::scanArcData(class TokenScanner &,class EdgeGen<void *,void *> *,class EdgeGen<void *,void *> *)" (?scanArcData@?$BasicGraphGen@PAXPAX@@UAEXAAVTokenScanner@@PAV?$EdgeGen@PAXPAX@@1@Z)
1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall TokenScanner::saveToken(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?saveToken@TokenScanner@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function "public: virtual void __thiscall BasicGraphGen<void *,void *>::scanArcData(class TokenScanner &,class EdgeGen<void *,void *> *,class EdgeGen<void *,void *> *)" (?scanArcData@?$BasicGraphGen@PAXPAX@@UAEXAAVTokenScanner@@PAV?$EdgeGen@PAXPAX@@1@Z)
1>C:\Users\Aditya Tyagi\source\repos\IsolationBranchingImplementation\Debug\IsolationBranchingImplementation.exe : fatal error LNK1120: 7 unresolved externals
1>Done building project "IsolationBranchingImplementation.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com