Author

Topic: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1 (Read 4058 times)

full member
Activity: 194
Merit: 100
BaiQi
solve it,thx. Grin Grin
member
Activity: 111
Merit: 10
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.
newbie
Activity: 22
Merit: 0
Not Find the error  Undecided
newbie
Activity: 22
Merit: 0
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.
hero member
Activity: 508
Merit: 500
Techwolf on #bitcoin and Reddit
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.
full member
Activity: 168
Merit: 100
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.
newbie
Activity: 22
Merit: 0
Ok I'll still keep trying and i wait for your feedback Wink
hero member
Activity: 508
Merit: 500
Techwolf on #bitcoin and Reddit
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.
newbie
Activity: 22
Merit: 0
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?
Jump to: