meritlabs / libmeritminer

Library that can mine merit.
GNU General Public License v3.0
8 stars 2 forks source link

Issue compiling under Visual Studio 2017 #16

Open SnackyC opened 5 years ago

SnackyC commented 5 years ago

C2678 binary '==': no operator found which takes a left-hand operand of type 'boost::asio::ip::tcp::endpoint' (or there is no acceptable conversion) in stratum.cpp 196

2>C:\Users\Dev\Desktop\Miners\libmeritminer\src\stratum\stratum.cpp(196): error C2678: binary '==': no operator found which takes a left-hand operand of type 'boost::asio::ip::tcp::endpoint' (or there is no acceptable conversion)
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared\guiddef.h(192): note: could be 'bool operator ==(const GUID &,const GUID &)'
2>C:\boost\include\boost-1_66\boost/asio/ip/address_v4.hpp(167): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::address_v4 &,const boost::asio::ip::address_v4 &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/impl/address_v6.ipp(232): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::address_v6 &,const boost::asio::ip::address_v6 &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/impl/address.ipp(210): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::address &,const boost::asio::ip::address &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/address_v4_iterator.hpp(138): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::basic_address_iterator<boost::asio::ip::address_v4> &,const boost::asio::ip::basic_address_iterator<boost::asio::ip::address_v4> &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/address_v6_iterator.hpp(159): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::basic_address_iterator<boost::asio::ip::address_v6> &,const boost::asio::ip::basic_address_iterator<boost::asio::ip::address_v6> &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/icmp.hpp(88): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::icmp &,const boost::asio::ip::icmp &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/tcp.hpp(130): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::tcp &,const boost::asio::ip::tcp &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/udp.hpp(86): note: or       'bool boost::asio::ip::operator ==(const boost::asio::ip::udp &,const boost::asio::ip::udp &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/basic_endpoint.hpp(190): note: or       'bool boost::asio::ip::basic_endpoint<boost::asio::ip::tcp>::operator ==(const boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> &,const boost::asio::ip::basic_endpoint<boost::asio::ip::tcp> &)' [found using argument-dependent lookup]
2>C:\boost\include\boost-1_66\boost/asio/ip/basic_resolver_iterator.hpp(144): note: or       'bool boost::asio::ip::basic_resolver_iterator<InternetProtocol>::operator ==(const boost::asio::ip::basic_resolver_iterator<InternetProtocol> &,const boost::asio::ip::basic_resolver_iterator<InternetProtocol> &)' [found using argument-dependent lookup]
2>        with
2>        [
2>            InternetProtocol=boost::asio::ip::tcp
2>        ]
2>C:\boost\include\boost-1_66\boost/asio/ip/basic_resolver_results.hpp(290): note: or       'bool boost::asio::ip::basic_resolver_results<Protocol>::operator ==(const boost::asio::ip::basic_resolver_results<Protocol> &,const boost::asio::ip::basic_resolver_results<Protocol> &)' [found using argument-dependent lookup]
2>        with
2>        [
2>            Protocol=boost::asio::ip::tcp
2>        ]
2>C:\Users\Dev\Desktop\Miners\libmeritminer\src\stratum\stratum.cpp(196): note: while trying to match the argument list '(boost::asio::ip::tcp::endpoint, boost::asio::ip::basic_resolver_iterator<InternetProtocol>)'
2>        with
2>        [
2>            InternetProtocol=boost::asio::ip::tcp
2>        ]
SnackyC commented 5 years ago

This error was fixed by the last commit (thank you for working so quickly), but I stumbled upon another one:

https://stackoverflow.com/questions/2561368/illegal-token-on-right-side-of on line 113 of minerd.cpp

I tried to implement the solutions on the page, adding #undef max caused this problem https://stackoverflow.com/questions/28887001/lnk2038-mismatch-detected-for-runtimelibrary-value-mt-staticrelease-doesn

changing it to cores = (std::numeric_limits<T>::max)(0, cores); didn't work for me either, but I'm not familiar with C++ and not sure how to declare the template.

lanciaominer commented 5 years ago

what are the steps and requirements to compile this on windows ? hope a windows binary release would be available. Thanks again so much

Retsediv commented 5 years ago

@SnackyC @lanciaominer You can download windows binary release here When there is a new version of libmeritminer we post about it in Discord #announcement channel with links to the binaries.

Retsediv commented 5 years ago

@SnackyC Could you post the output from the console during the compilation?

Maybe try: cores = (std::numeric_limits<int>::max)(0, cores);

lanciaominer commented 5 years ago

@Retsediv Thanks for the heads up, but i hope you can provide a windows binary release with the solo mining feature from the solo-mining branch as well. Thanks man

Retsediv commented 5 years ago

@lanciaominer not yet, solo mining is still under development

SnackyC commented 5 years ago

pulled the September 5 commit, issue persists, here's the console:

4>------ Rebuild All started: Project: merit-minerd, Configuration: Release x64 ------
4>Building Custom Rule C:/Users/Dev/Desktop/Miners/libmeritminer/CMakeLists.txt
4>CMake does not need to re-run because C:/Users/Dev/Desktop/Miners/libmeritminer/build/CMakeFiles/generate.stamp is up-to-date.
4>cl : Command line warning D9002: ignoring unknown option '-fPIC'
4>minerd.cpp
4>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version.  Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(113): error C2589: '(': illegal token on right side of '::'
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(113): error C2062: type 'unknown-type' unexpected
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(113): error C2059: syntax error: ')'
4>Done building project "merit-minerd.vcxproj" -- FAILED.

With @Retsediv's suggestion of cores = (std::numeric_limits<int>::max)(0, cores);:

4>------ Rebuild All started: Project: merit-minerd, Configuration: Release x64 ------
4>Building Custom Rule C:/Users/Dev/Desktop/Miners/libmeritminer/CMakeLists.txt
4>CMake does not need to re-run because C:/Users/Dev/Desktop/Miners/libmeritminer/build/CMakeFiles/generate.stamp is up-to-date.
4>cl : Command line warning D9002: ignoring unknown option '-fPIC'
4>minerd.cpp
4>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version.  Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(113): error C2660: 'std::numeric_limits<int>::max': function does not take 2 arguments
4>Done building project "merit-minerd.vcxproj" -- FAILED.

@lanciaominer I don't recall everything since I'm working on a few things simultaneously, but if you have cmake installed make the build directory and cmake .. and start working through errors. I recall having to compile boost and getting cmake to find both boost and cuda, once cmake finishes successfully you can open meritminer.vcxproj with the gui and compile for x64 release.

Retsediv commented 5 years ago

@SnackyC I have pushed changes into the master branch. Hopefully, it would help

SnackyC commented 5 years ago

Got the same error unfortunately

4>------ Rebuild All started: Project: merit-minerd, Configuration: Release x64 ------
4>Building Custom Rule C:/Users/Dev/Desktop/Miners/libmeritminer/CMakeLists.txt
4>CMake does not need to re-run because C:/Users/Dev/Desktop/Miners/libmeritminer/build/CMakeFiles/generate.stamp is up-to-date.
4>cl : Command line warning D9002: ignoring unknown option '-fPIC'
4>minerd.cpp
4>Info: Boost.Config is older than your compiler version - probably nothing bad will happen - but you may wish to look for an update Boost version.  Define BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE to suppress this message.
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(114): error C2589: '(': illegal token on right side of '::'
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(114): error C2062: type 'unknown-type' unexpected
4>C:\Users\Dev\Desktop\Miners\libmeritminer\src\minerd.cpp(114): error C2059: syntax error: ')'
4>Done building project "merit-minerd.vcxproj" -- FAILED.

Same error as previous post when trying cores = (std::numeric_limits<int>::max)(0, cores); as well.

I had tried #include <limits> as part of a previous attempt at the suggestion of the stackexchange post but it didn't work either.

Thanks for your time on this, looking forward to implementing the node-based meritminer on a windows platform with GPUs