[Nauty] nauty and Traces in modern C++

Johann Birnick johann.birnick at hotmail.de
Sat Feb 10 11:01:02 AEDT 2024


Hello,

I want to use nauty and Traces in a modern C++ project, which uses CMake 
for building. How to do that appropriately? In particular:

 1. In my current setup, when I want to run an example from the
    documentation, I get the following error:

    /usr/include/nauty/gtools.h:302:24: error: expected initializer
    before ‘gt_abort’
       302 | extern void NORET_ATTR gt_abort(const char*);
           |                        ^~~~~~~~
    /home/johann/Coding/MabreSolve/main.cpp: In function ‘int main()’:
    /home/johann/Coding/MabreSolve/main.cpp:31:13: error: ‘gt_abort’ was
    not declared in this scope; did you mean ‘gt_abort_1’?
        31 |             DYNALLOC1(int, lab1, lab1_sz, n, "malloc");
           |             ^~~~~~~~~

    Do you have any idea what's the problem and how to fix it?

 2. I guess in modern C++ one shouldn't use all these in capital letters
    written macros and global variables (DYNALLOC1, SG_ALLOC,
    NAUTYVERSIONID, and so on). Is there a way to do this the 'modern way'?

Thank you very much in advance!

Johann B.


More information about the Nauty mailing list