Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.2.2404 fails to build with gcc-14: encoding.hpp: 'string' 'cerr' 'endl' has not been declared; #192

Open
drew-parsons opened this issue Sep 15, 2024 · 1 comment

Comments

@drew-parsons
Copy link

netgen 6.2.2404 fails to build on debian unstable (linux)
The error message is

In file included from /build/netgen-6.2.2404+dfsg1/ng/ngpkg.cpp:58:
/build/netgen-6.2.2404+dfsg1/ng/encoding.hpp:116:15: error: 'string' has not been declared
  116 |     int Start(string filename) {
      |               ^~~~~~
/build/netgen-6.2.2404+dfsg1/ng/encoding.hpp: In member function 'int Mpeg::AddFrame()':
/build/netgen-6.2.2404+dfsg1/ng/encoding.hpp:76:23: warning: 'void av_init_packet(AVPacket*)' is deprecated [-Wdeprecated-declarations]
   76 |         av_init_packet(&pkt);
      |         ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:44,
                 from /build/netgen-6.2.2404+dfsg1/ng/encoding.hpp:8:
/usr/include/x86_64-linux-gnu/libavcodec/packet.h:653:6: note: declared here
  653 | void av_init_packet(AVPacket *pkt);
      |      ^~~~~~~~~~~~~~
/build/netgen-6.2.2404+dfsg1/ng/encoding.hpp:82:13: error: 'cerr' was not declared in this scope; did you mean 'std::cerr'?
   82 |             cerr << "Error encoding video frame: " << endl;
      |             ^~~~
      |             std::cerr
In file included from /build/netgen-6.2.2404+dfsg1/libsrc/include/mystdlib.h:4,
                 from /build/netgen-6.2.2404+dfsg1/ng/ngpkg.cpp:7:
/usr/include/c++/14/iostream:64:18: note: 'std::cerr' declared here
   64 |   extern ostream cerr;          ///< Linked to standard error (unbuffered)
      |                  ^~~~
/build/netgen-6.2.2404+dfsg1/ng/encoding.hpp:82:55: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   82 |             cerr << "Error encoding video frame: " << endl;
      |                                                       ^~~~
      |                                                       std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:741:5: note: 'std::endl' declared here
  741 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
...

netgen 6.2.2401 builds successfully without these errors.

Some netgen files #include <mystdlib.h>, which includes some C++ std libraries. However ng/encoding.hpp does not include mystdlib.h

Attempting to build with
cmake 3.30.3
gcc 14.2.0

@qbisi
Copy link

qbisi commented Nov 18, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants