Bitcoin Forum
April 26, 2024, 03:09:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] 0.9.0 compilation problem, libboost  (Read 4807 times)
m0Ray (OP)
Sr. Member
****
Offline Offline

Activity: 868
Merit: 251


View Profile
March 20, 2014, 09:26:29 AM
Last edit: April 10, 2014, 06:28:49 PM by m0Ray
 #1

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<charT>::getline(std::string&) [with charT = char; std::string = std::basic_string<char>]’:
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<class T> std::vector<std::basic_string<char> > boost::program_options::to_internal(const std::vector<T>&)’ 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?
1714144147
Hero Member
*
Offline Offline

Posts: 1714144147

View Profile Personal Message (Offline)

Ignore
1714144147
Reply with quote  #2

1714144147
Report to moderator
1714144147
Hero Member
*
Offline Offline

Posts: 1714144147

View Profile Personal Message (Offline)

Ignore
1714144147
Reply with quote  #2

1714144147
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714144147
Hero Member
*
Offline Offline

Posts: 1714144147

View Profile Personal Message (Offline)

Ignore
1714144147
Reply with quote  #2

1714144147
Report to moderator
1714144147
Hero Member
*
Offline Offline

Posts: 1714144147

View Profile Personal Message (Offline)

Ignore
1714144147
Reply with quote  #2

1714144147
Report to moderator
1714144147
Hero Member
*
Offline Offline

Posts: 1714144147

View Profile Personal Message (Offline)

Ignore
1714144147
Reply with quote  #2

1714144147
Report to moderator
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
March 20, 2014, 09:49:18 AM
 #2

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<char>&);
     }
 }


Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
m0Ray (OP)
Sr. Member
****
Offline Offline

Activity: 868
Merit: 251


View Profile
March 20, 2014, 10:02:42 AM
 #3

Applied the patch, still the same error.
justbtcme
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250



View Profile
March 20, 2014, 04:06:09 PM
 #4

Seems like a redundant line.
alienbob
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile WWW
March 25, 2014, 12:48:07 PM
 #5

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 <boost/filesystem.hpp>
 #include <boost/filesystem/fstream.hpp>
 #include <boost/foreach.hpp>
-#include <boost/program_options/detail/config_file.hpp>
-#include <boost/program_options/parsers.hpp>
-#include <openssl/crypto.h>
-#include <openssl/rand.h>
 
 // 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 <boost/program_options/detail/config_file.hpp>
+#include <boost/program_options/parsers.hpp>
+#include <openssl/crypto.h>
+#include <openssl/rand.h>
 
 using namespace std;

Eric
Visit my blog: http://alien.slackbook.org/blog/
m0Ray (OP)
Sr. Member
****
Offline Offline

Activity: 868
Merit: 251


View Profile
April 10, 2014, 06:18:45 PM
 #6

Applied alienbob's patch, works ok with 0.9.0 and 0.9.1.
Thanks!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!