#c #boost
Вопрос:
Я пытаюсь установить пакет под названием Siconos, который использует python и его библиотеки, а также C и другие библиотеки, такие как oce и occ. Он установлен правильно, но когда я запускаю код C с помощью Siconos, он выдает следующую ошибку Boost,
|===========================================================|
| Siconos software, version 4.4.0 - Copyright 2021 INRIA |
| |
| Free software under Apache 2.0 License. |
|===========================================================|
[ Generate CMakeLists.txt file in /scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/.siconos ]
[------------------- Configure project (cmake) --------------------]
-- Boost version: 1.65.1
-- Configuring done
-- Generating done
-- Build files have been written to: /scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/.siconos
[---------------------- Build project (make) ----------------------]
[ 33%] Built target BallPlugin
Scanning dependencies of target BouncingBallTS
[ 50%] Building CXX object CMakeFiles/BouncingBallTS.dir/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp.o
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp: In function ‘int main(int, char**)’:
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:147:12: error: ‘progress_display’ is not a member of ‘boost’
boost::progress_display show_progress(N);
^~~~~~~~~~~~~~~~
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:149:12: error: ‘timer’ is not a member of ‘boost’
boost::timer time;
^~~~~
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:150:10: error: request for member ‘restart’ in ‘time’, which is of non-class type ‘time_t(time_t*) noexcept {aka long int(long int*) noexcept}’
time.restart();
^~~~~~~
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:162:9: error: ‘show_progress’ was not declared in this scope
show_progress;
^~~~~~~~~~~~~
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:167:41: error: request for member ‘elapsed’ in ‘time’, which is of non-class type ‘time_t(time_t*) noexcept {aka long int(long int*) noexcept}’
cout << "Computation Time " << time.elapsed() << endl;
^~~~~~~
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:180:10: error: ‘SiconosException’ does not name a type; did you mean ‘SiconosVector’?
catch (SiconosExceptionamp; e)
^~~~~~~~~~~~~~~~
SiconosVector
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp:182:13: error: ‘e’ was not declared in this scope
cerr << e.report() << endl;
^
CMakeFiles/BouncingBallTS.dir/build.make:62: recipe for target 'CMakeFiles/BouncingBallTS.dir/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp.o' failed
make[2]: *** [CMakeFiles/BouncingBallTS.dir/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/BouncingBallTS.dir/all' failed
make[1]: *** [CMakeFiles/BouncingBallTS.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
File "/usr/local/bin/siconos", line 826, in <module>
main()
File "/usr/local/bin/siconos", line 151, in main
build_project(args)
File "/usr/local/bin/siconos", line 768, in build_project
run_command(cmake_build_command, args.quiet)
File "/usr/local/bin/siconos", line 799, in run_command
subprocess.run(command, check=True, **extra_args)
File "/usr/lib/python3.6/subprocess.py", line 438, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['cmake', '--build', '/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/.siconos', '--target', 'install', '--']' returned non-zero exit status 2.
Есть какие-нибудь предложения ?
Комментарии:
1. Возможно, в коде
/scratch/rsayoud/Documents/siconos-tutorials/examples/mechanics/BouncingBall/BouncingBallTS.cpp
отсутствует включение. https://www.boost.org/doc/libs/1_65_1/libs/timer/doc/cpu_timers.html
Ответ №1:
Скорее всего, в нем отсутствует необходимый #include
файл. Файлы Boost и другие могут включать другие файлы, но не указано, что еще они включают (обычно называемые «перетаскиванием»). Это означает, что если вы #include
что-то забудете, это все равно может сработать, потому что оно было вложено в другой заголовок. Но после обновления или в другой конфигурации это больше не работает, потому что внутренние включаемые файлы изменились.
Вы должны проверить документы Boost на наличие правильного включаемого файла для этого символа и добавить его в начало любого файла, содержащего ошибку. Это может потребоваться для нескольких файлов.