Errors when trying to create a forced file system in cygwin: error: expected unqualified identifier before the && token

I have installed cygwin 2.6with gcc 5.4. I installed boost.buildand it seems to work. However, when I try to create a file system module, it does not work with an error:

work@PC /lib/boost_1_62_0/libs/filesystem/example/test
$ ./build.sh
Compiling example programs...
tut4.cpp:40:18: error: expected unqualified-id before '&&' token
tut4.cpp:40:18: error: expected ';' before '&&' token
tut4.cpp:40:23: error: expected ';' before ':' token
tut4.cpp:40:23: error: expected primary-expression before ':' token
tut4.cpp:40:23: error: expected ')' before ':' token
tut4.cpp:40:23: error: expected primary-expression before ':' token
tut4.cpp:45:18: error: expected unqualified-id before '&&' token
tut4.cpp:45:18: error: expected ';' before '&&' token
tut4.cpp:45:23: error: expected ';' before ':' token
tut4.cpp:45:23: error: expected primary-expression before ':' token
tut4.cpp:45:23: error: expected ')' before ':' token
tut4.cpp:45:23: error: expected primary-expression before ':' token
tut4.cpp:40:21: error: label 'x' used but not defined
../../../../boost/system/error_code.hpp: At global scope:
../../../../boost/system/error_code.hpp:221:36: warning: 'boost::system::posix_category' defined but not
 used [-Wunused-variable]
     static const error_category &  posix_category = generic_category();
../../../../boost/system/error_code.hpp:222:36: warning: 'boost::system::errno_ecat' defined but not use
d [-Wunused-variable]
     static const error_category &  errno_ecat     = generic_category();
../../../../boost/system/error_code.hpp:223:36: warning: 'boost::system::native_ecat' defined but not us
ed [-Wunused-variable]
     static const error_category &  native_ecat    = system_category();
path_info.cpp:41:13: error: 'element' does not name a type
path_info.cpp:44:3: error: expected ';' before 'cout'
path_info.cpp:49:62: error: expected ')' before ';' token
../../../../boost/system/error_code.hpp: At global scope:
../../../../boost/system/error_code.hpp:221:36: warning: 'boost::system::posix_category' defined but not
 used [-Wunused-variable]
     static const error_category &  posix_category = generic_category();
../../../../boost/system/error_code.hpp:222:36: warning: 'boost::system::errno_ecat' defined but not use
d [-Wunused-variable]
     static const error_category &  errno_ecat     = generic_category();
../../../../boost/system/error_code.hpp:223:36: warning: 'boost::system::native_ecat' defined but not us
ed [-Wunused-variable]
     static const error_category &  native_ecat    = system_category();

What should I do to fix this?


I install b2in /usr/local/and install boost-build.jaminside /usr/local/share/boost-buildto have this value:

# Copyright 2001, 2002 Dave Abrahams
# Copyright 2002 Rene Rivera
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)


boost-build src/kernel ;
using gcc : 5.4 : g++-5.4 : <cxxflags>=c++11 ;  // Could it be that this settings is wrong or not applying during compilation?

I am trying to follow the instructions of the official performance improvement reports , which say that I should go as follows:

$ cd boost-root/libs/filesystem/example/test

$ ./setup.sh
Copying example programs...

$ ./build.sh
Compiling example programs...

$ ./tut1
Usage: tut1 path
+4
source share
1 answer

, C++11, .

boost, , jam boost env, . , - *.jam.

- :

b2 toolset=gcc cxxflags="-std=c++11" $* > build.log ./build.sh, .

+1

Source: https://habr.com/ru/post/1657613/


All Articles