ibroheem / cuap-gateway

CUAP [China Mobile USSD Application Protocol] gateway
4 stars 2 forks source link

Not able to compile #3

Open bipinojhamonty opened 2 years ago

bipinojhamonty commented 2 years ago

Getting this error while compiling cuap-gateway: g++ -O3 -DNDEBUG -fconcepts -std=c++2a main.cpp -I/usr/local/include/fmt -I/usr/local/include/json -I/usr/local/include/drogon -o cuap-gateway.elf -L/usr/local/lib64 -lfmt -ldrogon -ltrantor -ljsoncpp -luuid -lssl -lcrypto -lz -ldl -lpthread

In file included from /usr/local/include/fmt/time.h:12, from /usr/include/sys/types.h:132, from /usr/include/stdlib.h:314, from /opt/rh/devtoolset-8/root/usr/include/c++/8/cstdlib:75, from /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/stl_algo.h:59, from /opt/rh/devtoolset-8/root/usr/include/c++/8/algorithm:62, from /usr/local/include/fmt/format.h:31, from /usr/local/include/fmt/locale.h:11, from /opt/rh/devtoolset-8/root/usr/include/c++/8/clocale:42, from /opt/rh/devtoolset-8/root/usr/include/c++/8/x86_64-redhat-linux/bits/c++locale.h:41, from /opt/rh/devtoolset-8/root/usr/include/c++/8/bits/localefwd.h:40, from /opt/rh/devtoolset-8/root/usr/include/c++/8/string:43, from /usr/local/include/trantor/utils/Date.h:19, from /usr/local/include/trantor/net/EventLoop.h:20, from /usr/local/include/trantor/net/TcpClient.h:20, from gateway.h:4, from main.cpp:1: /opt/rh/devtoolset-8/root/usr/include/c++/8/ctime:60:11: error: ‘::clock_t’ has not been declared using ::clock_t; ^~~ ...

i am using the following version of

  1. OS

    cat /etc/redhat-release

    CentOS Linux release 7.9.2009 (Core)

  2. G++

    g++ --version

    g++ (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  3. CMake cmake version 3.22.20211220-g6b5c836 CMake suite maintained and supported by Kitware (kitware.com/cmake).

  4. FMT -- Version: 5.3.0

  5. JSonCpp JsonCpp Version: 1.9.5

  6. Dragon v1.7.4

  7. Trantor v1.5.4

  8. ArgParser The only Master

  9. cuap-gateway The only Master

Can anyone please help me solving this issue.

ibroheem commented 2 years ago

You have problem with your GCC installation

bipinojhamonty commented 2 years ago

hello ibroheem,

Now i tried to install everything on CentOS 8 and still getting the same error. Here is the error description

g++ -O3 -DNDEBUG -fconcepts -std=c++2a main.cpp -I/usr/local/include/fmt -I/usr/local/include/json -I/usr/local/include/trantor -I/usr/local/include/drogon -o cuap-gateway.elf -L/usr/local/lib64 -lfmt -ldrogon -ltrantor -ljsoncpp -luuid -lssl -lcrypto -lz -ldl -lpthread

In file included from /usr/local/include/fmt/time.h:12, from /usr/include/pthread.h:24, from /usr/include/c++/8/x86_64-redhat-linux/bits/gthr-default.h:35, from /usr/include/c++/8/x86_64-redhat-linux/bits/gthr.h:148, from /usr/include/c++/8/ext/atomicity.h:35, from /usr/include/c++/8/memory:73, from /usr/local/include/fmt/format.h:36, from /usr/local/include/fmt/locale.h:11, from /usr/include/c++/8/clocale:42, from /usr/include/c++/8/x86_64-redhat-linux/bits/c++locale.h:41, from /usr/include/c++/8/bits/localefwd.h:40, from /usr/include/c++/8/string:43, from /usr/local/include/trantor/utils/Date.h:19, from /usr/local/include/trantor/net/EventLoop.h:20, from /usr/local/include/trantor/net/TcpClient.h:20, from gateway.h:4, from main.cpp:1: /usr/include/c++/8/ctime:64:11: error: ‘::clock’ has not been declared using ::clock; ^~~~~ /usr/include/c++/8/ctime:65:11: error: ‘::difftime’ has not been declared using ::difftime; ^~~~ /usr/include/c++/8/ctime:66:11: error: ‘::mktime’ has not been declared using ::mktime; ^~ /usr/include/c++/8/ctime:67:11: error: ‘::time’ has not been declared using ::time; ^~~~ /usr/include/c++/8/ctime:68:11: error: ‘::asctime’ has not been declared using ::asctime; ^~~ /usr/include/c++/8/ctime:69:11: error: ‘::ctime’ has not been declared using ::ctime; ^~~~~ /usr/include/c++/8/ctime:70:11: error: ‘::gmtime’ has not been declared using ::gmtime; ^~ /usr/include/c++/8/ctime:71:11: error: ‘::localtime’ has not been declared using ::localtime; ^~~~~ /usr/include/c++/8/ctime:72:11: error: ‘::strftime’ has not been declared using ::strftime; ...

I am using now the following version of

  1. OS

    cat /etc/redhat-release

    CentOS Linux release 8.4.2105

  2. g++ --version

    g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-4) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  3. cmake --version

    cmake version 3.22.20211221-g9d80742 CMake suite maintained and supported by Kitware (kitware.com/cmake).

  4. FMT -- Version: 5.3.0

  5. JSonCpp JsonCpp Version: 1.9.5

  6. Dragon v1.7.4

  7. Trantor v1.5.4

  8. ArgParser The only Master

  9. cuap-gateway The only Master

As CentOS 8 comes with gcc 8, so probably the issue is not in gcc. Can you please help me in solving the issue.

ibroheem commented 2 years ago

Sorry, I don't have access to a Cent OS system, the issue seems to be from there. Have u tried gcc-9 and gcc-11 ?