miracl / MIRACL

MIRACL Cryptographic SDK: Multiprecision Integer and Rational Arithmetic Cryptographic Library is a C software library that is widely regarded by developers as the gold standard open source SDK for elliptic curve cryptography (ECC).
https://miracl.com
653 stars 242 forks source link

`error: conflicting declaration of C function ‘void fsub(flash, flash, flash)’` in Ubuntu #130

Closed mentalfl0w closed 7 months ago

mentalfl0w commented 7 months ago

Log:

FAILED: CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o 
/usr/bin/g++ -DKGCAPP_URI=\"KGCAPP\" -DKGCAPP_VERSION=1,0,0 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQWK_CORE_STATIC -DQWK_QUICK_STATIC -I/home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/include -I/home/runner/work/KGCAPP/KGCAPP -I/home/runner/work/KGCAPP/KGCAPP/include -I/home/runner/work/KGCAPP/KGCAPP/build/include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit/include -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/qwindowkit/src/../include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/MIRACL-Project/  -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/mkspecs/linux-g++ -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlIntegration -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtNetwork -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtGui -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlModels -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtOpenGL -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtSql -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -MF CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -c /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp
In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3:
/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:209: warning: "forever" redefined
  209 | #define forever for(;;)
      | 
In file included from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:57,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2:
/home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qforeach.h:78: note: this is the location of the previous definition
   78 | #    define forever Q_FOREVER
      | 
In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3:
/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1348:14: error: conflicting declaration of C function ‘void fmul(flash, flash, flash)’
 1348 | extern void  fmul(_MIPT_ flash,flash,flash);
      |              ^~~~
In file included from /usr/include/c++/11/cmath:45,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:33:20: note: previous declaration ‘float fmul(double, double)’
   33 | __MATHCALL_NARROW (__MATHCALL_NAME (mul), __MATHCALL_REDIR_NAME (mul), 2);
      |                    ^~~~~~~~~~~~~~~
In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3:
/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1349:14: error: conflicting declaration of C function ‘void fdiv(flash, flash, flash)’
 1349 | extern void  fdiv(_MIPT_ flash,flash,flash);
      |              ^~~~
In file included from /usr/include/c++/11/cmath:45,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:27:20: note: previous declaration ‘float fdiv(double, double)’
   27 | __MATHCALL_NARROW (__MATHCALL_NAME (div), __MATHCALL_REDIR_NAME (div), 2);
      |                    ^~~~~~~~~~~~~~~
In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3:
/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1350:14: error: conflicting declaration of C function ‘void fadd(flash, flash, flash)’
 1350 | extern void  fadd(_MIPT_ flash,flash,flash);
      |              ^~~~
In file included from /usr/include/c++/11/cmath:45,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:24:20: note: previous declaration ‘float fadd(double, double)’
   24 | __MATHCALL_NARROW (__MATHCALL_NAME (add), __MATHCALL_REDIR_NAME (add), 2);
      |                    ^~~~~~~~~~~~~~~
In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3:
/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1351:14: error: conflicting declaration of C function ‘void fsub(flash, flash, flash)’
 1351 | extern void  fsub(_MIPT_ flash,flash,flash);
      |              ^~~~
In file included from /usr/include/c++/11/cmath:45,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7,
                 from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9,
                 from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2:
/usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:39:20: note: previous declaration ‘float fsub(double, double)’
   39 | __MATHCALL_NARROW (__MATHCALL_NAME (sub), __MATHCALL_REDIR_NAME (sub), 2);
      |                    ^~~~~~~~~~~~~~~

I could find a temporary solution, but that would be too inelegant (it would require changes to the miracl source code), so I'd like to give feedback to see if the miracl developers have a better approach. Environment: Ubuntu 22.04 Test Project Link

mcarrickscott commented 7 months ago

Name clashes like these will inevitably sometimes occur with C.

Probably the simplest solution is to remove #define MR_FLASH from mirdef.h and rebuild the miracl library. Your application probably does not require the flash arithmetic feature of miracl.

Mike

On Sat, May 4, 2024 at 8:45 AM Dylan Liu @.***> wrote:

Log:

FAILED: CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o /usr/bin/g++ -DKGCAPP_URI=\"KGCAPP\" -DKGCAPP_VERSION=1,0,0 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQWK_CORE_STATIC -DQWK_QUICK_STATIC -I/home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/include -I/home/runner/work/KGCAPP/KGCAPP -I/home/runner/work/KGCAPP/KGCAPP/include -I/home/runner/work/KGCAPP/KGCAPP/build/include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit/include -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/qwindowkit/src/../include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/MIRACL-Project/ -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/mkspecs/linux-g++ -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlIntegration -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtNetwork -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtGui -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlModels -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtOpenGL -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtSql -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -MF CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -c /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:209: warning: "forever" redefined 209 #define forever for(;;)
In file included from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:57, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qforeach.h:78: note: this is the location of the previous definition 78 # define forever Q_FOREVER

In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1348:14: error: conflicting declaration of C function ‘void fmul(flash, flash, flash)’ 1348 | extern void fmul(MIPT flash,flash,flash); | ^~~~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:33:20: note: previous declaration ‘float fmul(double, double)’ 33 | MATHCALL_NARROW (__MATHCALL_NAME (mul), MATHCALL_REDIR_NAME (mul), 2); | ^~~~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1349:14: error: conflicting declaration of C function ‘void fdiv(flash, flash, flash)’ 1349 | extern void fdiv(MIPT flash,flash,flash); | ^~~~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:27:20: note: previous declaration ‘float fdiv(double, double)’ 27 | MATHCALL_NARROW (__MATHCALL_NAME (div), MATHCALL_REDIR_NAME (div), 2); | ^~~~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1350:14: error: conflicting declaration of C function ‘void fadd(flash, flash, flash)’ 1350 | extern void fadd(MIPT flash,flash,flash); | ^~~~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:24:20: note: previous declaration ‘float fadd(double, double)’ 24 | MATHCALL_NARROW (__MATHCALL_NAME (add), MATHCALL_REDIR_NAME (add), 2); | ^~~~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1351:14: error: conflicting declaration of C function ‘void fsub(flash, flash, flash)’ 1351 | extern void fsub(MIPT flash,flash,flash); | ^~~~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:39:20: note: previous declaration ‘float fsub(double, double)’ 39 | MATHCALL_NARROW (__MATHCALL_NAME (sub), MATHCALL_REDIR_NAME (sub), 2); | ^~~~~~~

I could find a temporary solution, but that would be too inelegant (it would require changes to the miracl source code), so I'd like to give feedback to see if the miracl developers have a better approach. Environment: Ubuntu 22.04 Test Project Link https://github.com/mentalfl0w/KGCAPP

— Reply to this email directly, view it on GitHub https://github.com/miracl/MIRACL/issues/130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU3ZDR6KIUORA2C2JTRA3TZASGYNAVCNFSM6AAAAABHGT2RYWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TQOBSGA2DOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

mentalfl0w commented 7 months ago

Hi Mike: I have solved this problem by following you guide. Thanks a lot.

Name clashes like these will inevitably sometimes occur with C. Probably the simplest solution is to remove #define MR_FLASH from mirdef.h and rebuild the miracl library. Your application probably does not require the flash arithmetic feature of miracl. Mike On Sat, May 4, 2024 at 8:45 AM Dylan Liu @.*> wrote: Log: FAILED: CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o /usr/bin/g++ -DKGCAPP_URI=\"KGCAPP\" -DKGCAPP_VERSION=1,0,0 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICK_LIB -DQT_SQL_LIB -DQWK_CORE_STATIC -DQWK_QUICK_STATIC -I/home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/include -I/home/runner/work/KGCAPP/KGCAPP -I/home/runner/work/KGCAPP/KGCAPP/include -I/home/runner/work/KGCAPP/KGCAPP/build/include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/RibbonUI/lib_source/3rdparty/qwindowkit/include -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/qwindowkit/src/../include -I/home/runner/work/KGCAPP/KGCAPP/3rdparty/MIRACL-Project/ -I/home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/6.6.3/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3 -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/6.6.3/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/mkspecs/linux-g++ -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlIntegration -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtNetwork -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtGui -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQmlModels -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtOpenGL -isystem /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtSql -O3 -DNDEBUG -fPIC -MD -MT CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -MF CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/KGCAPP.dir/KGCAPP_autogen/mocs_compilation.cpp.o -c /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:209: warning: "forever" redefined 209 | #define forever for(;;) | In file included from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:57, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qforeach.h:78: note: this is the location of the previous definition 78 | # define forever Q_FOREVER | In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1348:14: error: conflicting declaration of C function ‘void fmul(flash, flash, flash)’ 1348 | extern void fmul(MIPT flash,flash,flash); | ^~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:33:20: note: previous declaration ‘float fmul(double, double)’ 33 | MATHCALL_NARROW (__MATHCALL_NAME (mul), MATHCALL_REDIR_NAME (mul), 2); | ^~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1349:14: error: conflicting declaration of C function ‘void fdiv(flash, flash, flash)’ 1349 | extern void fdiv(MIPT flash,flash,flash); | ^~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:27:20: note: previous declaration ‘float fdiv(double, double)’ 27 | MATHCALL_NARROW (__MATHCALL_NAME (div), MATHCALL_REDIR_NAME (div), 2); | ^~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1350:14: error: conflicting declaration of C function ‘void fadd(flash, flash, flash)’ 1350 | extern void fadd(MIPT flash,flash,flash); | ^~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:24:20: note: previous declaration ‘float fadd(double, double)’ 24 | MATHCALL_NARROW (__MATHCALL_NAME (add), MATHCALL_REDIR_NAME (add), 2); | ^~~~~ In file included from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/util.h:6, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keyparams.h:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keyparams.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:3: /home/runner/work/KGCAPP/KGCAPP/build/3rdparty/MIRACL-Project/linux64/include/miracl.h:1351:14: error: conflicting declaration of C function ‘void fsub(flash, flash, flash)’ 1351 | extern void fsub(MIPT flash,flash,flash); | ^~ In file included from /usr/include/c++/11/cmath:45, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qnumeric.h:15, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtCore/qglobal.h:62, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQml/qtqmlglobal.h:8, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qtquickglobal.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/qquickitem.h:7, from /home/runner/work/KGCAPP/Qt/6.6.3/gcc_64/include/QtQuick/QQuickItem:1, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/../../../include/keydatamanager.h:4, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/6YEA5652QU/moc_keydatamanager.cpp:9, from /home/runner/work/KGCAPP/KGCAPP/build/KGCAPP_autogen/mocs_compilation.cpp:2: /usr/include/x86_64-linux-gnu/bits/mathcalls-narrow.h:39:20: note: previous declaration ‘float fsub(double, double)’ 39 | MATHCALL_NARROW (__MATHCALL_NAME (sub), MATHCALL_REDIR_NAME (sub), 2); | ^~~~~ I could find a temporary solution, but that would be too inelegant (it would require changes to the miracl source code), so I'd like to give feedback to see if the miracl developers have a better approach. Environment: Ubuntu 22.04 Test Project Link https://github.com/mentalfl0w/KGCAPP — Reply to this email directly, view it on GitHub <#130>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU3ZDR6KIUORA2C2JTRA3TZASGYNAVCNFSM6AAAAABHGT2RYWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI3TQOBSGA2DOMA . You are receiving this because you are subscribed to this thread.Message ID: *@.>