snap-stanford / snap

Stanford Network Analysis Platform (SNAP) is a general purpose network analysis and graph mining library.
Other
2.16k stars 795 forks source link

Build Failed:error: no matching function for call to 'TTable::GetStrVal(TInt&, int&)' #206

Closed Kotoricyann closed 3 years ago

Kotoricyann commented 3 years ago

I use git to clone latest code. I build on a Ubuntu device and failed. The logs are as followed:

##@ubuntu1:~/snap-master/examples/localmotifcluster$ make clean
rm -f *.o  localmotifclustermain  localmotifclustermain.exe
rm -rf Debug Release
##@ubuntu1:~/snap-master/examples/localmotifcluster$ make all
make -C ../../snap-core
make[1]: Entering directory `/home/**/snap-master/snap-core'
g++ -c -std=c++98 -Wall -O3 -DNDEBUG -fopenmp Snap.cpp -I../glib-core
In file included from Snap.h:28:0,
                 from Snap.cpp:4:
conv.h: In function 'PGraphMP TSnap::ToNetworkMP(PTable, const TStr&, const TStr&, TStrV&, TStrV&, TStrV&, TAttrAggr)':
**conv.h:1013:73: error: no matching function for call to 'TTable::GetStrVal(TInt&, TInt&)'
               Graph->AddStrAttrDatE(RowId, Table->GetStrVal(Index, RowId), ColName);**
                                                                         ^
conv.h:1013:73: note: candidate is:
In file included from Snap.h:27:0,
                 from Snap.cpp:4:
table.h:973:8: note: TStr TTable::GetStrVal(const TStr&, const TInt&) const
   TStr GetStrVal(const TStr& ColName, const TInt& RowIdx) const {
        ^
table.h:973:8: note:   no known conversion for argument 1 from 'TInt' to 'const TStr&'
In file included from Snap.h:28:0,
                 from Snap.cpp:4:
**conv.h:1050:73: error: no matching function for call to 'TTable::GetStrVal(TInt&, TInt&)'
               Graph->AddStrAttrDatE(RowId, Table->GetStrVal(Index, RowId), ColName);**
                                                                         ^
conv.h:1050:73: note: candidate is:
In file included from Snap.h:27:0,
                 from Snap.cpp:4:
table.h:973:8: note: TStr TTable::GetStrVal(const TStr&, const TInt&) const
   TStr GetStrVal(const TStr& ColName, const TInt& RowIdx) const {
        ^
table.h:973:8: note:   no known conversion for argument 1 from 'TInt' to 'const TStr&'
In file included from Snap.h:28:0,
                 from Snap.cpp:4:
conv.h: In function 'PGraphMP TSnap::ToNetworkMP(PTable, const TStr&, const TStr&, TStrV&, TAttrAggr)':
conv.h:1996:79: error: no matching function for call to 'TTable::GetStrVal(TInt&, int&)'
           Graph->AddStrAttrDatE(CurrRowIdx, Table->GetStrVal(Index, CurrRowIdx), ColName);
                                                                               ^
conv.h:1996:79: note: candidate is:
In file included from Snap.h:27:0,
                 from Snap.cpp:4:
table.h:973:8: note: TStr TTable::GetStrVal(const TStr&, const TInt&) const
   TStr GetStrVal(const TStr& ColName, const TInt& RowIdx) const {
        ^
table.h:973:8: note:   no known conversion for argument 1 from 'TInt' to 'const TStr&'
In file included from Snap.h:28:0,
                 from Snap.cpp:4:
conv.h: In function 'PGraphMP TSnap::ToNetworkMP(PTable, const TStr&, const TStr&, TStrV&, PTable, const TStr&, TStrV&, TAttrAggr)':
conv.h:2478:79: error: no matching function for call to 'TTable::GetStrVal(TInt&, int&)'
           Graph->AddStrAttrDatE(CurrRowIdx, Table->GetStrVal(Index, CurrRowIdx), ColName);
                                                                               ^
conv.h:2478:79: note: candidate is:
In file included from Snap.h:27:0,
                 from Snap.cpp:4:
table.h:973:8: note: TStr TTable::GetStrVal(const TStr&, const TInt&) const
   TStr GetStrVal(const TStr& ColName, const TInt& RowIdx) const {
        ^
table.h:973:8: note:   no known conversion for argument 1 from 'TInt' to 'const TStr&'
In file included from Snap.h:28:0,
                 from Snap.cpp:4:
conv.h:2509:78: error: no matching function for call to 'TTable::GetStrVal(TInt&, int&)'
             Graph->AddStrAttrDatN(NId, NodeTable->GetStrVal(Index, CurrRowIdx), ColName);
                                                                              ^
conv.h:2509:78: note: candidate is:
In file included from Snap.h:27:0,
                 from Snap.cpp:4:
table.h:973:8: note: TStr TTable::GetStrVal(const TStr&, const TInt&) const
   TStr GetStrVal(const TStr& ColName, const TInt& RowIdx) const {
        ^
table.h:973:8: note:   no known conversion for argument 1 from 'TInt' to 'const TStr&'
In file included from Snap.cpp:29:0:
subgraph.cpp: In function 'PNEANet TSnap::GetInEgonetAttr(const PNEANet&, int, int)':
subgraph.cpp:352:9: warning: unused variable 'EId' [-Wunused-variable]
     int EId;
         ^
In file included from ../glib-core/base.h:178:0,
                 from Snap.h:9,
                 from Snap.cpp:4:
../glib-core/bd.h: In instantiation of 'void TPt<TRec>::UnRef() const [with TRec = TNEANet]':
../glib-core/bd.h:480:16:   required from 'TPt<TRec>::~TPt() [with TRec = TNEANet]'
network.h:2015:54:   required from here
../glib-core/bd.h:472:31: warning: deleting object of polymorphic class type 'TNEANet' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
       if (Addr->CRef.NoRef()){delete Addr;}
                               ^
In file included from ../glib-core/base.cpp:80:0,
                 from Snap.cpp:6:
../glib-core/fl.cpp: In static member function 'static void TFile::Copy(const TStr&, const TStr&, const bool&, const bool&)':
../glib-core/fl.cpp:1213:24: warning: ignoring return value of 'ssize_t write(int, const void*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
  write(output, '\0', 1);
                        ^
In file included from ../glib-core/base.cpp:88:0,
                 from Snap.cpp:6:
../glib-core/os.cpp: In function 'int GetCurrentDirectory(int, char*)':
../glib-core/os.cpp:560:20: warning: ignoring return value of 'char* getcwd(char*, size_t)', declared with attribute warn_unused_result [-Wunused-result]
   getcwd(Bf, MxBfL);
                    ^
../glib-core/os.cpp: In static member function 'static void TSysProc::SetLowPriority()':
../glib-core/os.cpp:802:11: warning: ignoring return value of 'int nice(int)', declared with attribute warn_unused_result [-Wunused-result]
   nice(19);
           ^
In file included from Snap.cpp:20:0:
timenet.cpp: In static member function 'static PTimeNet TTimeNet::LoadArxiv(const TStr&, const TStr&)':
timenet.cpp:396:28: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     fgets(Line, 1024, PprF);
                            ^
timenet.cpp:422:29: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     fgets(Line, 1024, CiteF);
                             ^
timenet.cpp: In static member function 'static PTimeNet TTimeNet::LoadPatents(const TStr&, const TStr&)':
timenet.cpp:493:26: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   fgets(Line, 1024, PatF); // skip 1st line
                          ^
timenet.cpp:496:28: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     fgets(Line, 1024, PatF);
                            ^
timenet.cpp:514:27: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
   fgets(Line, 1024, CiteF); // skip 1st line
                           ^
timenet.cpp:517:29: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     fgets(Line, 1024, CiteF);
                             ^
timenet.cpp: In static member function 'static PTimeNet TTimeNet::LoadAmazon(const TStr&)':
timenet.cpp:574:25: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     fgets(line, 2024, F);
                         ^
make[1]: *** [Snap.o] Error 1
make[1]: Leaving directory `/home/**/snap-master/snap-core'
make: *** [../../snap-core/Snap.o] Error 2
roks commented 3 years ago

A previous change caused this problem under certain compilers. The latest update should fix the problem. Please update your repo copy and try again.