josephhaggerty
josephhaggerty

Reputation: 21

Cryptonote C++ compile error with invalid operands

I am working with cryptonote repo for a project and am at the point where I need to compile the binaries.

When I run make, I get the following error:

/Documents/huntcoin/src/CryptoNoteCore/SwappedMap.h:185:14: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘const char [24]’ to binary ‘operator<<’
   std::count << "SwappedMap cache hits: " << m_cacheHits << ", misses: " << m_cacheMisses << " (" << std::fixed << std::setprecision(2) << static_cast<double>(m_cacheMisses) / (m_cacheHits + m_cacheMisses) * 100 << "%)" << std::endl;
   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~

I am not super familiar with C++ and am sure it might be a simple parenthesis error, but it could be something more.

For some context, the previous make error I got was that std::cout was not defined, which I assumed was just a typo for count. Maybe that was wrong as well.

Any help with C++ or cryptonote would be much appreciated!

Upvotes: 0

Views: 137

Answers (1)

YePhIcK
YePhIcK

Reputation: 5866

You've got an extra n that is causing you trouble. The code should read:

std::cout << "SwappedMap c.....

std::cout is the default console output (console output) stream while std::count is not defined

The std::cout is defined in a header file iostream so all you need to do is put this line of code next to other #include statements at the top of your file:

#include <iostream>

Cheers

Upvotes: 1

Related Questions