Skip to content

Compilation failure on Debian (gcc-12)

This is weird, at best.

  • We test gcc-10 on Ubuntu 20.04
  • We test gcc-13 on Ubuntu 24.04

You'd assume that the versions in between would work, right? Wrong, gcc-12 fails badly with:

In file included from /root/ns-allinone-3.44/ns-3.44/build/include/ns3/symmetric-adjacency-matrix.h:1,
                 from /root/ns-allinone-3.44/ns-3.44/src/antenna/test/test-adjacency-matrix.cc:9:
/root/ns-allinone-3.44/ns-3.44/src/antenna/utils/symmetric-adjacency-matrix.h:240:36: error: expected ‘)’ before ‘numRows’
  240 |     SymmetricAdjacencyMatrix(size_t numRows = 0, T value = {})
      |                             ~      ^~~~~~~~
      |                                    )

plus a zillion other errors.

The exact version is gcc (Debian 12.2.0-14) 12.2.0, and it's the default compiler for Debian 12.

The "solution" is to downgrade to gcc-11, but it's more a workaround.

Note that gcc-11 works, even if we didn't test it explicitly.

Edited by Tommaso Pecorella