# Problems in compiling actions quiz

**URL:** <https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916>\
**Category:** ROS2 in 5 Days C++\
**Created:** [August 22, 2023, 2:55pm UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916 "2023-08-22T14:55:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simo97](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Simo97](https://get-help.theconstruct.ai/u/Simo97)\
**Post date:** [August 22, 2023, 2:55pm UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/1 "2023-08-22T14:55:46Z")

</div>

Hi!  
I completed the actions quiz and it works, but when I submit the quiz I have strange errors:  
 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/a/a9317e0e906342381ed3dbf38a0f80f7b7543c2a.png)  
This is really strange, because before submitting the quiz everything works well and I can compile with colcon build. After having submitted, if I try again, I have this

 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/8/840058e75ab0bcd9477a8aac2a970a152781894b.png)  
 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/1/13e0c9646efc89d551388c73bf5d873b9ad508ef.png)  
 ![image](https://get-help.robotigniteacademy.com/uploads/default/original/2X/0/0a94847f0df2947efb462c568d250b64ee21b59f.png)

It seems a bug with colcon build.  
If I recompile with these lines:

_cd ~/ros2\_ws_  
_rm -rf build/ install/ log/_  
_colcon build_  
_source install/setup.bash_

_colcon build_ does not work. If I compile with the --packages-select option and **in the correct order** (for instance, actions\_quiz\_msg and then actions\_quiz) everything is ok.  
What is the problem? Can you help me?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [August 23, 2023, 9:38am UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/3 "2023-08-23T09:38:30Z")

</div>

That error makes sense, because `actions_quiz` depends on `actions_quiz_msg`, so the latter has to be compiled before the former.

What seems to be missing here are some entries in `CMakeLists.txt` and/or `package.xml`, telling `colcon build` what package must be built first.

How did you create `actions_quiz`? Did you pass `actions_quiz_msg` as a dependency when creating the package?

---

<div class="post-metadata">

**Author:** ![Simo97](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Simo97](https://get-help.theconstruct.ai/u/Simo97)\
**Post date:** [August 23, 2023, 9:43am UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/4 "2023-08-23T09:43:42Z")

</div>

Hi @bayodesegun,  
thanks for your response.  
No, I did not add actions\_quiz\_msg as a dependency. I first created and compiled actions\_quiz, then actions\_quiz\_msg and finally I modified the CmakeLists of actions\_quiz by adding find\_packages and the right dependencies.

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [August 23, 2023, 9:50am UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/5 "2023-08-23T09:50:01Z")

</div>

I suspect that you didn’t add all the necessary entries, or there is some bug. Manually adding entries is prone to errors. Here is what you can do to debug:

> Create a new test package, say `actions_quiz_test` and add `actions_quiz_msg` as dependency during creation. Then compare the entries in the `CMakeLists.txt` and `package.xml` of this test package to what you have in the same files in `actions_quiz`. Make necessary corrections and let’s know how it goes.

---

<div class="post-metadata">

**Author:** ![Simo97](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Simo97](https://get-help.theconstruct.ai/u/Simo97)\
**Post date:** [August 23, 2023, 10:14am UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/6 "2023-08-23T10:14:26Z")

</div>

Thank you @bayodesegun, I missed **\< depend\>actions\_quiz\_msg\< /depend\>** in package.xml  
Thank you for your support

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [August 28, 2023, 10:14am UTC](https://get-help.theconstruct.ai/t/problems-in-compiling-actions-quiz/25916/7 "2023-08-28T10:14:59Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
