I updated my project from boost 1.67 to boost 1.72. Now I can't compile it because of the following:
I had code:
boost::asio::ip::icmp::resolver resolver(m_socket.get_io_service());
where m_socket is object of boost::asio::ip::icmp::socket. Compilation error in this case looks like:
Error C2039 'get_io_service': is not a member of 'boost::asio::basic_raw_socket'
Similar error was discussed here and the proposed solution was to call get_executor() method and then get executor's context. So I changed my code. Now it looks like:
boost::asio::ip::icmp::resolver resolver(m_socket.get_executor().context());
But still get compilation error:
Error C2039 'get_executor': is not a member of 'boost::asio::execution_context' (compiling source file PathMTUDiscovery.cpp) SocketsLib C:\Work\BuildFiles\boost\1.72.0\include\boost\asio\detail\io_object_impl.hpp 87
I tried to find something in Networking TS compatibility, but didn't find the solution here.
Anyone knows how to solve the error properly?
Related
I'm using Boost 1.79.0 on Windows, and when compiling the project, I get this error:
C:\boost_1_79_0\boost/log/sources/threading_models.hpp(101,59): error C2039: 'unlock_upgrade_and_lock_shared': is not
a member of 'boost::log::v2_mt_nt6::aux::light_rw_mutex'
What could be causing this, and how to fix it? Or is it a bug?
I'm using MSVC.
I am getting this strange error when compiling a large CPP file, at this line:
#include <boost/regex/v4/regex.hpp>
Error C2027 use of undefined type
'boost::mpl::bool_'
C:\github\microsoft\vcpkg\installed\x86-windows\include\boost\regex\v4\basic_regex_parser.hpp 59
In bool_fwd.hpp I see:
typedef bool_<true> true_;
typedef bool_<false> false_;
In basic_regex_parser.hpp this is the line generating the error:
inline boost::intmax_t umax()
{
return umax(mpl::bool_<std::numeric_limits<boost::intmax_t>::digits >= std::numeric_limits<std::size_t>::digits>());
}
It appears basic_regex_parser.hpp isn't including bool_fwd.hpp but diving into these files I am lost what's wrong.
I've moved that #include to be right at the top of my stdafx.h file so it's before any other headers, and get the same result. We've recently switched from manually building boost 1.68 => 1.76 via vcpkg but I don't know which if either is the cause. We also switched to C++17 and I note boost has a dependency on std::numeric_limits, could this is the issue?
This isn't supported, see same issue in https://github.com/boostorg/regex/issues/145
The code is compiling fine in VS2015 but in VS2019 code is throwing errors for CPPUNIT. Is it not supported in C++17 std? if not how to resolve these error:
Code:
class CAbcTestCase : public CppUnit::TestCase
{
CPPUNIT_TEST_SUITE(CAbcTestCase);
CPPUNIT_TEST(AbcThruRMB);
CPPUNIT_TEST(AbcMultiThruRMB);
CPPUNIT_TEST(AbcFolderThruRMB);
CPPUNIT_TEST(AbcUseFileThruRMB);
........
........
//CPPUNIT_TEST(Abc_UpdateRegistry);
CPPUNIT_TEST(Abc_Initialize);
**CPPUNIT_TEST_SUITE_END();** // *This line has all the below mentioned errors*
}
CPPUNIT error:
Error C2039 'auto_ptr': is not a member of 'std'
Error C2065 'auto_ptr': undeclared identifier.
Error C2660 'CHistoryTestCase::suite': function does not take 1 arguments
Error C2275 'CppUnit:: TestSuite': illegal use of this type as an expression
Error (active) E0135 namespace "std" has no member "auto_ptr"
Does std C++17 does not support CPPUNIT?
You've got the relation backwards. It is the program that has to be compatible with the programming language. So, the question is, does (this version of) CPPUNIT work with C++17?
Based on the error, if CPPUNIT does indeed use std::auto_ptr, then it isn't C++17 compatible, because that class was removed from the standard library.
That said, perhaps it is possible that it is one of the test cases that is incompatible with C++17 rather than CPPUNIT itself? Also note that according to wikipedia, CPPUNIT "has been forked several times". If it is the framework that is incompatible, then the problem may be solvable by using a fork that is actively developed.
I am working through some example code from Lazar and Penea, Mastreing Qt5:
https://github.com/PacktPublishing/Mastering-Qt-5
I think I am starting to understand the code, but I am stuck with a compilation error in the method "addAlbum" in the class "AlbumModel", The offending line is
unique_ptr<Album> newAlbum(new Album(album));
which yields the error message
error: use of deleted function ‘Album::Album(const Album&)’
unique_ptr<Album> newAlbum(new Album(album));
^
I am using CMake 3.10.2 and cpp 7.5.0. I presume the github code is correct, so this error is a bit puzzling. Although there are a lot of "use of deleted function" discussions here on stackoverflow, I have not been able to determine the cause of the error.
I am building driver for my USB device. While building using msvisual studio10 I am getting following two errors:
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5):
error MSB6006: "cmd.exe" exited with code
and
C:/boost32/include/boost-1_48\boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp(34):
error C2766: explicit specialization;
'boost::numeric::numeric_cast_traits<char,char>' has already been
defined 2>
C:/boost32/include/boost-1_48\boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp(18)
: see previous definition of 'numeric_cast_traits<char,char,void>'
Help me out in getting rid of these two errors which are hindering tyhe building process of my project.
I realize the question is quite old, but some people seem to be interested in resolution.
I believe, the boost compilation problem might be described here. The problem is with boost version 1.48, exactly what you seem to have.
Then, to fix it try using newer boost version or just take the problematic header from newer boost version.
Now, the cmd.exe error is most likely caused by this compilation failure.