Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: DrMotz on July 22, 2014, 11:21:26 AM



Title: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: DrMotz on July 22, 2014, 11:21:26 AM
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?


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: Dare on July 22, 2014, 04:44:28 PM
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.


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: DrMotz on July 22, 2014, 05:33:22 PM
Ok I'll still keep trying and i wait for your feedback ;)


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: AliceWonder on July 22, 2014, 07:34:34 PM
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.


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: Dare on July 23, 2014, 07:16:42 AM
Ok I'll still keep trying and i wait for your feedback ;)

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.


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: DrMotz on July 23, 2014, 09:34:37 AM
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.


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: DrMotz on July 23, 2014, 09:44:10 PM
Not Find the error  :-\


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: anush3070 on August 01, 2014, 10:15:03 PM
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.


Title: Re: Mac Osx Wallet-Qt Compile Error make: *** [build/bloom.o] Error 1
Post by: Mainbrain on November 27, 2014, 09:07:08 AM
solve it,thx. ;D ;D