dines icon indicating copy to clipboard operation
dines copied to clipboard

Build fails: ‘std::function’ has not been declared

Open larytet opened this issue 7 years ago • 2 comments

The toolchain is g++ (Ubuntu 7.2.0-8ubuntu3.2) 7.2.0

diff --git a/src/utils.cpp b/src/utils.cpp
index ab0a7fa..48a03fa 100644
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -16,6 +16,7 @@
 #include <sstream>
 #include <string.h>
 #include <random>
+#include <tr1/functional>
 
 using namespace std;
 
@@ -40,7 +41,7 @@ static std::vector<char> charset()
 };
 
 // Internal random string generator
-static std::string random_string_int( size_t length, std::function<char(void)> rand_char )
+static std::string random_string_int( size_t length, std::tr1::function<char(void)> rand_char )
 {
     std::string str(length, 0);
     std::generate_n(str.begin(), length, rand_char);

larytet avatar Jul 03 '18 07:07 larytet

Thanks for the patch :+1: . Can you do a pull request, please?

crondaemon avatar Jul 03 '18 12:07 crondaemon

I just experimented with the framework a little bit. I did not fork the repository. I am not sure if my patch is necessary. I am not using dines at this point and not planning to use it in the near future. I have opted for embedding a simple DNS traffic generator into my code.

larytet avatar Sep 20 '18 19:09 larytet