srcML / srcSlice

Lightweight tool for slicing
34 stars 16 forks source link

Error when using old version #27

Closed duybn-0885 closed 3 years ago

duybn-0885 commented 4 years ago

Hi there, I am trying to use this tool with the old version in OldSrcSlice-(DO-NOT-DELETE) branch. I follow 5 steps in the readme file. But in step 4 when I type 'make' some error appear. This seems like that : duy@Noah:~/Documents/SRCSlice/test$ make [ 27%] Built target srcsax_static [ 33%] Building CXX object src/CMakeFiles/srcslicetest.dir/cpp/srcSliceHandler.cpp.o In file included from /home/duy/Documents/SRCSlice/srcSlice/src/cpp/srcSliceHandler.cpp:21:0: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:46:37: error: ‘function’ is not a member of ‘std’ std::unordered_map<std::string, std::function<void()>> process_map; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:46:37: error: ‘function’ is not a member of ‘std’ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:46:56: error: template argument 2 is invalid std::unordered_map<std::string, std::function<void()>> process_map; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:46:56: error: template argument 5 is invalid /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:46:57: error: expected unqualified-id before ‘>’ token std::unordered_map<std::string, std::function<void()>> process_map; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:47:37: error: ‘function’ is not a member of ‘std’ std::unordered_map<std::string, std::function<void()>> process_map3; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:47:37: error: ‘function’ is not a member of ‘std’ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:47:56: error: template argument 2 is invalid std::unordered_map<std::string, std::function<void()>> process_map3; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:47:56: error: template argument 5 is invalid /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:47:57: error: expected unqualified-id before ‘>’ token std::unordered_map<std::string, std::function<void()>> process_map3; ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp: In constructor ‘srcSliceHandler::srcSliceHandler(SliceDictionary)’: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:183:9: error: ‘process_map’ was not declared in this scope process_map = { ^ In file included from /home/duy/Documents/SRCSlice/srcSlice/src/cpp/srcSliceHandler.cpp:21:0: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:374:9: error: ‘process_map3’ was not declared in this scope process_map3 = { ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp: In member function ‘virtual void srcSliceHandler::startElement(const char, const char, const char, int, const srcsax_namespace, int, const srcsax_attribute)’: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:779:41: error: ‘function’ is not a member of ‘std’ std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:779:41: error: ‘function’ is not a member of ‘std’ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:779:60: error: template argument 2 is invalid std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:779:60: error: template argument 5 is invalid /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:779:61: error: expected unqualified-id before ‘>’ token std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:780:13: error: ‘process’ was not declared in this scope if (process != process_map.end()) { ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:780:24: error: ‘process_map’ was not declared in this scope if (process != process_map.end()) { ^ In file included from /home/duy/Documents/SRCSlice/srcSlice/src/cpp/srcSliceHandler.cpp:21:0: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp: In member function ‘virtual void srcSliceHandler::endElement(const char, const char, const char*)’: /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:921:41: error: ‘function’ is not a member of ‘std’ std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:921:41: error: ‘function’ is not a member of ‘std’ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:921:60: error: template argument 2 is invalid std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:921:60: error: template argument 5 is invalid /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:921:61: error: expected unqualified-id before ‘>’ token std::unordered_map<std::string, std::function<void()>>::const_iterator ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:922:13: error: ‘process3’ was not declared in this scope if (process3 != process_map3.end()) { ^ /home/duy/Documents/SRCSlice/srcSlice/src/headers/srcSliceHandler.hpp:922:25: error: ‘process_map3’ was not declared in this scope if (process3 != process_map3.end()) { ^ src/CMakeFiles/srcslicetest.dir/build.make:62: recipe for target 'src/CMakeFiles/srcslicetest.dir/cpp/srcSliceHandler.cpp.o' failed make[2]: [src/CMakeFiles/srcslicetest.dir/cpp/srcSliceHandler.cpp.o] Error 1 CMakeFiles/Makefile2:87: recipe for target 'src/CMakeFiles/srcslicetest.dir/all' failed make[1]: [src/CMakeFiles/srcslicetest.dir/all] Error 2 Makefile:94: recipe for target 'all' failed make: *** [all] Error 2

Need some help! Thank you so much

cnewman commented 4 years ago

Hi @duybn-0885,

What OS are you using? I can attempt to replicate this and see if I spot the error. Most likely it's a bad cmake flag but I can't be sure just yet.

s1530129650 commented 4 years ago

@cnewman The same error occurred in our computer. OS: ubuntu 16

shaybanerjee commented 4 years ago

same here :(

cnewman commented 4 years ago

@shaybanerjee @s1530129650

Sorry for the delayed response. Make sure it is compiling with C++ 11 or greater. This error is saying that some of the more recent C++ functionality is not being recognized (std::function is an C++ 11 feature).

Make sure the compilers on your system are up to date-- you can use apt to do so. If it is all up to date, check the version of your compilers and then check this webpage: https://en.cppreference.com/w/cpp/compiler_support to see if the version you have supports C++11 features.

Let me know if all of that fails.