Bitcoin Forum
May 21, 2024, 10:50:53 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1  (Read 4040 times)
DrMotz (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
July 22, 2014, 11:21:26 AM
 #1

Quote
src/bloom.cpp:63:32: error: member function 'begin' not viable: 'this' argument has type 'const uint256',
but function is not marked const
vector data(hash.begin(), hash.end());
^~~~
src/uint256.h:344:20: note: 'begin' declared here
unsigned char* begin()
^
src/bloom.cpp:93:32: error: member function 'begin' not viable: 'this' argument has type 'const uint256',
but function is not marked const
vector data(hash.begin(), hash.end());
^~~~
src/uint256.h:344:20: note: 'begin' declared here
unsigned char* begin()
^
2 errors generated.
make: *** [build/bloom.o] Error 1

Have a tip?
Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
July 22, 2014, 04:44:28 PM
 #2

There might be a bug in your altcoin; the error is generated by the non-const uint256 begin() function being invoked on a const uint256 object ("hash", which is referred to by "this" in the error message), which is invalid. You should probably edit the functions giving errors in bloom.cpp to accept non-const arguments rather than modifying the uint256 type, but I'm not familiar with this section of the code so I'm not certain of how it's intended to work.

However, that section of the code appears to be the same as in an altcoin that I made myself when experimenting and which works fine, so it may also be an issue with some part of your build process (particularly if your altcoin works on other platforms or for other users). I'll try building it myself and see if it works on linux.

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
DrMotz (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
July 22, 2014, 05:33:22 PM
 #3

Ok I'll still keep trying and i wait for your feedback Wink
AliceWonder
Full Member
***
Offline Offline

Activity: 168
Merit: 100



View Profile
July 22, 2014, 07:34:34 PM
 #4

This is because OS X compiler is more picky.

The various fixes I did to get quarkcoind to build in OS X were of the same kind of error - see

http://www.domblogger.net/puzzle/q/quark-master_osx.patch

to see the kind of fixes you'll need.

Basically the function expects one type but the call to the function sends it a different type.

gnu c++ compiler is forgiving, Xcode c++ compiler is not.

QuarkCoin - what I believe bitcoin was intended to be. On reddit: http://www.reddit.com/r/QuarkCoin/
Dare
Hero Member
*****
Offline Offline

Activity: 508
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
July 23, 2014, 07:16:42 AM
 #5

Ok I'll still keep trying and i wait for your feedback Wink

The linux build completed without errors, and I ended up with a torcoind in the src dirctory, so I'm assuming it worked (that is, any other potential bugs are logic errors, and wouldn't affect your problem; I didn't run it). As far as I can tell, it's either an issue with the OSX makefile somehow (unlikely, but I'm unfamiliar with makefiles) or it's an OSX-specific compiler error as AliceWonder mentioned. I don't have a mac, so I won't be able to help much in either case.

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
DrMotz (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
July 23, 2014, 09:34:37 AM
Last edit: July 23, 2014, 12:05:44 PM by DrMotz
 #6

Ok.

Ok I have the source of quark loaded, and its runs.

Now I just have to find out where exactly was the problem that  ....

Thanks.
DrMotz (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
July 23, 2014, 09:44:10 PM
 #7

Not Find the error  Undecided
anush3070
Member
**
Offline Offline

Activity: 111
Merit: 10


View Profile
August 01, 2014, 10:15:03 PM
 #8

Quote
src/bloom.cpp:63:32: error: member function 'begin' not viable: 'this' argument has type 'const uint256',
but function is not marked const
vector data(hash.begin(), hash.end());
^~~~
src/uint256.h:344:20: note: 'begin' declared here
unsigned char* begin()
^
src/bloom.cpp:93:32: error: member function 'begin' not viable: 'this' argument has type 'const uint256',
but function is not marked const
vector data(hash.begin(), hash.end());
^~~~
src/uint256.h:344:20: note: 'begin' declared here
unsigned char* begin()
^
2 errors generated.
make: *** [build/bloom.o] Error 1

Have a tip?


Modify
src/uint256.h

Line: 344:

Code:
    unsigned char* begin()
    {
        return (unsigned char*)&pn[0];
    }
to
Code:
    unsigned char* begin()
 const    {
        return (unsigned char*)&pn[0];
    }


&


Line: 349:

Code:
    unsigned char* end()
    {
        return (unsigned char*)&pn[WIDTH];
    }
to
Code:
    unsigned char* end()
   const  {
        return (unsigned char*)&pn[WIDTH];
    }



This Should Resolve your problem.

CLOSED!

Only Existing Customers will be Served.
Mainbrain
Full Member
***
Offline Offline

Activity: 194
Merit: 100

BaiQi


View Profile WWW
November 27, 2014, 09:07:08 AM
 #9

solve it,thx. Grin Grin

Show me your Bitcoin address.
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!