• Uncategorized

About linux : Updating-to-new-ubuntu-server-breaks-g-build-with-a-bunch-of-c9-errors

Question Detail

We are moving to a new Ubuntu server (newer Ubuntu version) and the old build is not working. We get tons of errors from c++/9. A couple examples below. Any idea how I get the build (a single .cpp file) to work using g++?

/usr/include/c++/9/array: In function 'bool std::operator<(const std::array<_Tp, _Nm>&, const std::array<_Tp, _Nm>&)':
/usr/include/c++/9/array:264:19: error: 'lexicographical_compare' is not a member of 'std'; did you mean 'lexicographical_compare'?
  264 |       return std::lexicographical_compare(__a.begin(), __a.end(),
      |                   ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/9/memory:62,
                 from /usr/include/unicode/localpointer.h:45,
                 from /usr/include/unicode/uenum.h:23,
                 from /usr/include/unicode/ucnv.h:53,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:810,
                 from /usr/include/libxml2/libxml/xmlerror.h:10,
                 from /usr/include/libxml2/libxml/xpath.h:26,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-xml.h:27,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-env.h:29,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-client.h:27,
                 from myapp.cpp:6318:
/usr/include/c++/9/bits/stl_algobase.h:1277:5: note: 'lexicographical_compare' declared here
 1277 |     lexicographical_compare(_II1 __first1, _II1 __last1,
      |     ^~~~~~~~~~~~~~~~~~~~~~~


/usr/include/c++/9/array: In member function 'void std::array<_Tp, _Nm>::fill(const value_type&)':
/usr/include/c++/9/array:117:14: error: 'fill_n' is not a member of 'std'; did you mean 'fill_n'?
  117 |       { std::fill_n(begin(), size(), __u); }
      |              ^~~~~~
In file included from /usr/include/c++/9/memory:62,
                 from /usr/include/unicode/localpointer.h:45,
                 from /usr/include/unicode/uenum.h:23,
                 from /usr/include/unicode/ucnv.h:53,
                 from /usr/include/libxml2/libxml/encoding.h:31,
                 from /usr/include/libxml2/libxml/parser.h:810,
                 from /usr/include/libxml2/libxml/xmlerror.h:10,
                 from /usr/include/libxml2/libxml/xpath.h:26,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-xml.h:27,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-env.h:29,
                 from /usr/local/include/libcsoap-1.1/libcsoap/soap-client.h:27,
                 from myapp.cpp:6318:

Question Answer

I setup a test.cpp and included the same headers as myapp.cpp and it worked. Weird, so I then tried a few #define items included in myapp.cpp and tried again, worked. Now in myapp.cpp the include files for the soap-client.h was down in the middle of the code for CGI support. I moved the #include for that up to the top with the other #include items and it compiled fine.

My only thought is there must have been something in the code, either a function, typedef or #define that conflicted with some of the standard headers?

Anyway, if you run in to something like that, here is one thing to check.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.