error: arithmetic on a pointer to an incomplete type 'Xstring'

Hi there,

since upgrading to the latest Xcode and Command Line Tools, I get the follwoing error when compiling:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/wrap_iter.h:133:13: error: arithmetic on a pointer to an incomplete type 'Xstring' __i += __n; ~~~ ^

Does anyone has an idea, how to overcome this , is there a compiler flag which I am missing ?

Thanks a lot

Best Hannes.

PS: here is the full compilation and error: g++ -DPACKAGE_NAME="xfitter" -DPACKAGE_TARNAME="xfitter" -DPACKAGE_VERSION="VERSION_NUMBER" -DPACKAGE_STRING="xfitter\ VERSION_NUMBER" -DPACKAGE_BUGREPORT="" -DPACKAGE_URL="" -DPACKAGE="xfitter" -DVERSION="VERSION_NUMBER" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=".libs/" -DFC_FUNC(name,NAME)=name\ ##\ _ -DFC_FUNC_(name,NAME)=name\ ##\ _ -DF77_FUNC(name,NAME)=name\ ##\ _ -DF77_FUNC_(name,NAME)=name\ ##\ _ -DHAVE_BLAS=1 -DHAVE_LAPACK=1 -DLHAPDF_ENABLED=1 -DLHAPDF_FAMILY=6 -DROOT_ENABLED=1 -I. -fPIC -I./linalg -fPIC -Wno-deprecated -stdlib=libc++ -pthread -std=c++17 -m64 -I/opt/homebrew/Cellar/root/6.26.06_2/include/root -w -g -O2 -std=c++17 -lstdc++ -MT FitPars_base.o -MD -MP -MF .deps/FitPars_base.Tpo -c -o FitPars_base.o FitPars_base.cc In file included from FitPars_base.cc:10: In file included from ./FitPars_base.h:10: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/map:495: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__node_handle:15: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/memory:681: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__memory/raw_storage_iterator.h:16: In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/iterator:609: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/wrap_iter.h:133:13: error: arithmetic on a pointer to an incomplete type 'Xstring' __i += __n; ~~~ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/wrap_iter.h:126:38: note: in instantiation of member function 'std::__wrap_iter<Xstring *>::operator+=' requested here {__wrap_iter __w(*this); __w += __n; return __w;} ^ ./Xstring.h:40:32: note: in instantiation of member function 'std::__wrap_iter<Xstring *>::operator+' requested here A.erase(A.begin(),A.begin()+start); ^ ./Xstring.h:27:7: note: forward declaration of 'Xstring' class Xstring; ^ 1 error generated.

Replies

Hi again, in the meantime I found out that the error occurs because of -std=c++17. With -std=c++11 it works. Does anyone have an idea how to correct /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/__iterator/wrap_iter.h so that it works also with -std=c++17 ?

Thanks a lot Best hannes