Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Ask Question
Edit the question to include
desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem
. This will help others answer the question.
Closed
6 years ago
.
Hey Stackoverflow Community,
right now i have have the following problem: I want to compile c++ with mac osx.10.11. But every time i want to make the code it gives me an errorcode. I already googled that, but i found nothing.
hashGenesisBlock = uint256("0x01");
if (true && genesis.GetHash() != hashGenesisBlock)
Logprintf("recalculating params for mainnet.\n");
Logprintf("old mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
Logprintf("old mainnet genesis hash: %s\n", hashGenesisBlock.ToString().c_str());
// deliberately empty for loop finds nonce value.
for(genesis.nNonce == 0; genesis.GetHash() > bnProofOfWorkLimit; genesis.nNonce++){ }
Logprintf("new mainnet genesis merkle root: %s\n", genesis.hashMerkleRoot.ToString().c_str());
Logprintf("new mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c_str());
Logprintf("new mainnet genesis hash: %s\n", genesis.GetHash().ToString().c_str());
The error message:
Making all in src
CXX libgamebit_common_a-chainparams.o
chainparams.cpp:143:13: error: use of undeclared identifier 'Logprintf'
Logprintf("recalculating params for mainnet.\n");
chainparams.cpp:144:72: error: member reference base type 'uint32_t'
(aka 'unsigned int') is not a structure or union
...Logprintf("old mainnet genesis nonce: %s\n", genesis.nNonce.ToString().c...
Do you have any ideas why im getting this kind of error?
Actually im trying to compile bitcoind.
I hope you can help me.
Thanks!
–
–
You should concentrate on the first compiler error:
error: use of undeclared identifier 'Logprintf'
That is, you are using this identifier Logprintf
, probably a function, but it is not defined. Likely, you are missing a #include
that defines it.
The next error:
error: member reference base type 'uint32_t'
if you look at line 144, column 72, it is this one:
Logprintf("old mainnet genesis nonce: %s\n", genesis.nNonce.ToString()
column 72|
So your nNonce
is of type uint32_t
and you are trying to call member function ToString()
on it. But basic types in C++ do not have member functions, only structures (ie, classes) and unions have.
I suspect that you are trying to compile some C++/CLI code with a pure C++ compiler. I'm afraid some translation will be needed.
This last error, you can fix, once you have the proper definition of Logprintf
, by writing:
Logprintf("old mainnet genesis nonce: %u\n", (unsigned)genesis.nNonce);
–
–
–
–
–