I am having trouble installing the Stanford C++ Libraries, in particular, the Graph related libraries that I need to use for a project. I am using the Visual Studio IDE, Eclipse IDE, so instructions tailored to either would be appreciated.
I have done the following already:
-> Downloaded and unzipped the library at https://stanford.edu/~stepp/cppdoc/
-> selected the 'collections' folder in StanfordCPPLib as #include directory for Eclipse/Visual Studio
-> things seem to work until this point, and #include works. But During compile time, a ton of other 'unresolved inclusions' occur.
Please can someone who has actually installed the library/willing to do so, help me to do the same. I have spent quite a bit of time trying to solve this myself, and this is a major bottleneck.
Specs: Windows 10 Home MY CODE:
#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;
}
RESULT:
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 ==========