user3120717
user3120717

Reputation: 21

Error while compiling openbabel, clock error

I am trying to compile openbabel software but I get this error, do you know what I should fix? Below is the last few lines through terminating the compilation. I followed the installation instructions and have the required software packages installed. I have this Debian 6.1.85-1 linux installed.

Thank you

Smith

In file included from /home/vasek/openbabel-3.1.1/include/openbabel/format.h:22,
                 from /home/vasek/openbabel-3.1.1/include/openbabel/obconversion.h:37,
                 from /home/vasek/openbabel-3.1.1/include/openbabel/obmolecformat.h:36,
                 from /home/vasek/openbabel-3.1.1/src/formats/asciiformat.cpp:19:
/home/vasek/openbabel-3.1.1/include/openbabel/plugin.h:41:42: warning: ‘template<class _Arg1, class _Arg2, class _Result> struct std::binary_function’ is deprecated [-Wdeprecated-declarations]
   41 | struct OBERROR CharPtrLess : public std::binary_function<const char*,const char*, bool>
      |                                          ^~~~~~~~~~~~~~~
In file included from /usr/include/c++/12/string:48,
                 from /usr/include/c++/12/bits/locale_classes.h:40,
                 from /usr/include/c++/12/bits/ios_base.h:41,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /home/vasek/openbabel-3.1.1/include/openbabel/obconversion.h:24:
/usr/include/c++/12/bits/stl_function.h:131:12: note: declared here
  131 |     struct binary_function
      |            ^~~~~~~~~~~~~~~
[ 34%] Building CXX object src/formats/CMakeFiles/asciiformat.dir/__/depict/asciipainter.cpp.o
In file included from /home/vasek/openbabel-3.1.1/src/depict/asciipainter.cpp:18:
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h: In member function ‘void OpenBabel::OBStopwatch::Start()’:
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:65:14: error: ‘clock’ was not declared in this scope
   65 |       start= clock();
      |              ^~~~~
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:40:1: note: ‘clock’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
   39 | #include <math.h>
  +++ |+#include <ctime>
   40 |
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h: In member function ‘double OpenBabel::OBStopwatch::Lap()’:
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:70:13: error: ‘clock’ was not declared in this scope
   70 |       stop= clock();
      |             ^~~~~
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:70:13: note: ‘clock’ is defined in header ‘<ctime>’; did you forget to ‘#include <ctime>’?
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:71:40: error: ‘CLOCKS_PER_SEC’ was not declared in this scope
   71 |       return((stop - start) / (double) CLOCKS_PER_SEC);
      |                                        ^~~~~~~~~~~~~~
/home/vasek/openbabel-3.1.1/include/openbabel/obutil.h:71:40: note: the macro ‘CLOCKS_PER_SEC’ had not yet been defined
In file included from /usr/include/time.h:33,
                 from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/gthr.h:148,
                 from /usr/include/c++/12/ext/atomicity.h:35,
                 from /usr/include/c++/12/bits/ios_base.h:39,
                 from /usr/include/c++/12/ios:42,
                 from /usr/include/c++/12/istream:38,
                 from /usr/include/c++/12/sstream:38,
                 from /home/vasek/openbabel-3.1.1/include/openbabel/depict/painter.h:25,
                 from /home/vasek/openbabel-3.1.1/include/openbabel/depict/asciipainter.h:21,
                 from /home/vasek/openbabel-3.1.1/src/depict/asciipainter.cpp:19:
/usr/include/x86_64-linux-gnu/bits/time.h:34: note: it was later defined here
   34 | #define CLOCKS_PER_SEC  ((__clock_t) 1000000)
      |
make[2]: *** [src/formats/CMakeFiles/asciiformat.dir/build.make:90: src/formats/CMakeFiles/asciiformat.dir/__/depict/asciipainter.cpp.o] Chyba 1
make[1]: *** [CMakeFiles/Makefile2:1718: src/formats/CMakeFiles/asciiformat.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

Upvotes: 1

Views: 93

Answers (0)

Related Questions