Author

Topic: [SOLVED] 0.9.0 compilation problem, libboost (Read 4808 times)

sr. member
Activity: 868
Merit: 251
April 10, 2014, 02:18:45 PM
#6
Applied alienbob's patch, works ok with 0.9.0 and 0.9.1.
Thanks!
newbie
Activity: 1
Merit: 0
I created a patch to revert the move of the lines that provided the workaround for older boost versions. Someone moved those lines after the boost includes which is not correct.
Can someone please inform the bitcoin developers about this?

Code:
# Between bitcoin 0.8.6 and 0.9.0 a workaround for older versions of boost
# was moved a bit down in the util.cpp file, thereby rendering it useless.
# This patch reverses that move of code.

--- bitcoin-0.9.0/src/util.cpp.orig 2014-03-16 11:05:28.000000000 +0100
+++ bitcoin-0.9.0/src/util.cpp 2014-03-25 12:00:33.825478432 +0100
@@ -66,10 +66,6 @@
 #include
 #include
 #include
-#include
-#include
-#include
-#include
 
 // Work around clang compilation problem in Boost 1.46:
 // /usr/include/boost/program_options/detail/config_file.hpp:163:17: error: call to function 'to_internal' that is neither visible in the template definition nor found by argument-dependent lookup
@@ -81,6 +77,10 @@
     }
 }
 
+#include
+#include
+#include
+#include
 
 using namespace std;

Eric
Visit my blog: http://alien.slackbook.org/blog/
sr. member
Activity: 420
Merit: 250
Seems like a redundant line.
sr. member
Activity: 868
Merit: 251
Applied the patch, still the same error.
hero member
Activity: 812
Merit: 1022
No Maps for These Territories
It's requesting another function than in the workaround. Can you try adding this line?
Code:
diff --git a/src/util.cpp b/src/util.cpp
index 36dfd8a..68c6543 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -78,6 +78,7 @@
 namespace boost {
     namespace program_options {
         std::string to_internal(const std::string&);
+        std::string to_internal(const std::vector&);
     }
 }

sr. member
Activity: 868
Merit: 251
Code:
  CXX      util.o
In file included from util.cpp:69:0:
/usr/include/boost/program_options/detail/config_file.hpp: In instantiation of ‘bool boost::program_options::detail::basic_config_file_iterator::getline(std::string&) [with charT = char; std::string = std::basic_string]’:
util.cpp:1429:1:   required from here
/usr/include/boost/program_options/detail/config_file.hpp:164:13: error: ‘to_internal’ was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
In file included from /usr/include/boost/program_options/detail/parsers.hpp:9:0,
                 from /usr/include/boost/program_options/parsers.hpp:265,
                 from util.cpp:70:
/usr/include/boost/program_options/detail/convert.hpp:75:34: note: ‘template std::vector > boost::program_options::to_internal(const std::vector&)’ declared here, later in the translation unit
make[3]: *** [util.o] Error 1

Linux, libboost 1.49.0 and gcc 4.7.2.

While searching for similar problems and solutions, I found that this problem in bitcoin was eliminated about 2 years ago. I found even special workarounds in util.cpp (bitcoin) and config_file.hpp (libboost includes) code. But now, as I see, this problem is back again.
Version 0.8.6 compiles without any problems. I tried to compile 0.9.0 on another distro with libboost 1.53 and it works. But I need 0.9.0 on my «tried and true» distro...

I never used libboost in my programs and now trying to understand, what happens, but still no success.

Can anyone help?
Jump to: