# Compiling KillSwitch Demo for mangOH Red

**URL:** <https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780>\
**Category:** mangOH Red\
**Created:** [February 18, 2020, 12:00am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780 "2020-02-18T00:00:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![franzkaiser](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@franzkaiser](https://mangoh.discourse.group/u/franzkaiser)\
**Post date:** [February 18, 2020, 12:00am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780/1 "2020-02-18T00:00:10Z")

</div>

Hello,

i’m hardly trying to create a legato app that uses CAN BUS.  
Actually i am trying to get the KillSwitch Demo running on mangOH Red.

But it seems that it can only run on mangOH green.

unfortunately its not compilable.

First error is in **KillSwitch/canOpen/Component.cdef** where the Base Path is missing:  
api:  
{

- 

```
   mangoh_muxCtrl.api

```

- 

```
   ${MANGOH_ROOT}/apps/MuxControl/mangoh_muxCtrl.api

```

}

And some othe rlittle things… but i am ending um with several errors:

mkapp -t wp77xx killSwitch.adef  
[4/22] Compiling C source  
FAILED: /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/9360366597b53deec561966454cca21e/obj/37bf64dd96a9d129c4f3ab8771413d28.o  
/opt/swi/SWI9X06Y\_02.32.02.00/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/opt/swi/y22-ext-wp77xx/sysroots/armv7a-neon-poky-linux-gnueabi -MMD -MF /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/9360366597b53deec561966454cca21e/obj/37bf64dd96a9d129c4f3ab8771413d28.o.d -Wall -Werror -fvisibility=hidden -c /home/kaiser/mangOH/samples/Demos/KillSwitch/canOpen/can\_ctrl.c -o /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/9360366597b53deec561966454cca21e/obj/37bf64dd96a9d129c4f3ab8771413d28.o -DLE\_FILENAME=`basename /home/kaiser/mangOH/samples/Demos/KillSwitch/canOpen/can_ctrl.c` -DMK\_TOOLS\_BUILD -DLEGATO\_EMBEDDED -fPIC -I /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx -I/home/kaiser/legato\_framework/legato/interfaces -I/home/kaiser/legato\_framework/legato/framework/include -I/home/kaiser/legato\_framework/legato/build/wp77xx/framework/include -I/home/kaiser/mangOH/samples/Demos/KillSwitch -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/9360366597b53deec561966454cca21e/src -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee/server -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee/server -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/66793a95636118665a3708e58211a86b -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/66793a95636118665a3708e58211a86b -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/66793a95636118665a3708e58211a86b/client -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/66793a95636118665a3708e58211a86b/client -DLE\_COMPONENT\_NAME=canOpen -DLE\_LOG\_SESSION=canOpen\_LogSession -DLE\_LOG\_LEVEL\_FILTER\_PTR=canOpen\_LogLevelFilterPtr -Wno-parentheses -fno-strict-aliasing -DPF\_CAN=29 -DAF\_CAN=PF\_CAN -D\_COPAPI\_EXTERN  
/home/kaiser/mangOH/samples/Demos/KillSwitch/canOpen/can\_ctrl.c:122:19: error: ‘bit\_timing’ defined but not used [-Werror=unused-const-variable=]  
static const WORD bit\_timing[9] = { // bit-timing table:  
^ ~~~~~~~~~  
cc1: all warnings being treated as errors  
[8/22] Compiling C++ source  
FAILED: /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/f1c62c0f2aa070e692e891414cdb2bcb/obj/74a9e7f5415f3cc33f172b9253959b52.o  
/opt/swi/SWI9X06Y\_02.32.02.00/sysroots/x86\_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot=/opt/swi/y22-ext-wp77xx/sysroots/armv7a-neon-poky-linux-gnueabi -MMD -MF /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/f1c62c0f2aa070e692e891414cdb2bcb/obj/74a9e7f5415f3cc33f172b9253959b52.o.d -Wall -Werror -fvisibility=hidden -c /home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp -o /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/f1c62c0f2aa070e692e891414cdb2bcb/obj/74a9e7f5415f3cc33f172b9253959b52.o -DLE\_FILENAME=`basename /home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp` -DMK\_TOOLS\_BUILD -DLEGATO\_EMBEDDED -fPIC -I /home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx -I/home/kaiser/legato\_framework/legato/interfaces -I/home/kaiser/legato\_framework/legato/framework/include -I/home/kaiser/legato\_framework/legato/build/wp77xx/framework/include -I/home/kaiser/mangOH/samples/Demos/KillSwitch -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/component/f1c62c0f2aa070e692e891414cdb2bcb/src -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/5bf669534557b7b1d0651312ce92c844 -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/5bf669534557b7b1d0651312ce92c844 -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/5bf669534557b7b1d0651312ce92c844/client -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/5bf669534557b7b1d0651312ce92c844/client -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee/client -I/home/kaiser/mangOH/samples/Demos/KillSwitch/\_build\_killSwitch/wp77xx/api/7d9eb81221abe5f8ee8a5a71ddb65eee/client -DLE\_COMPONENT\_NAME=killSwitch -DLE\_LOG\_SESSION=killSwitch\_LogSession -DLE\_LOG\_LEVEL\_FILTER\_PTR=killSwitch\_LogLevelFilterPtr -std=c++11  
In file included from /home/kaiser/legato\_framework/legato/framework/include/legato.h:188:0,  
from /home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:9:  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp: In member function ‘void DemoStateMachine::updateState()’:  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:83:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::DISABLED);  
^ ~~~~~~~  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 9 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:83:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::DISABLED);  
^ ~~~~~~~  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:96:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_HOT);  
^ ~~~~~~~  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 9 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:96:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_HOT);  
^ ~~~~~~~  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 8 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:109:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_NORMAL);  
^ ~~~~~~~  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:530:48: error: format ‘%d’ expects argument of type ‘int’, but argument 9 has type ‘State’ [-Werror=format=]  
formatString, ## **VA\_ARGS** );   
^  
/home/kaiser/legato\_framework/legato/framework/include/le\_log.h:544:41: note: in expansion of macro ‘\_LE\_LOG\_MSG’  
#define LE\_DEBUG(formatString, …) \_LE\_LOG\_MSG(LE\_LOG\_DEBUG, formatString, ## **VA\_ARGS** )  
^ ~~~~~~~~~~  
/home/kaiser/mangOH/samples/Demos/KillSwitch/killSwitch/killSwitch.cpp:109:17: note: in expansion of macro ‘LE\_DEBUG’  
LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_NORMAL);  
^ ~~~~~~~  
cc1plus: all warnings being treated as errors  
[9/22] Compiling C source  
ninja: build stopped: subcommand failed.  
➜ KillSwitch git:(8b4ac33) ✗ git status  
HEAD detached at 8b4ac33  
Changes not staged for commit:  
(use “git add …” to update what will be committed)  
(use “git checkout – …” to discard changes in working directory)

```
modified: canOpen/Component.cdef

```

Untracked files:  
(use “git add …” to include in what will be committed)

```
_build_killSwitch/

```

no changes added to commit (use “git add” and/or “git commit -a”)

Maybe i am simply still too new to legato app programming…

---

<div class="post-metadata">

**Author:** ![franzkaiser](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@franzkaiser](https://mangoh.discourse.group/u/franzkaiser)\
**Post date:** [February 18, 2020, 12:00am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780/2 "2020-02-18T00:00:47Z")

</div>

Is anyone out there who is interested as a freelancer to help us out?

---

<div class="post-metadata">

**Author:** ![franzkaiser](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@franzkaiser](https://mangoh.discourse.group/u/franzkaiser)\
**Post date:** [February 18, 2020, 12:02am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780/3 "2020-02-18T00:02:26Z")

</div>

> [@franzkaiser](#):
>
> all warnings being treated as errors

How can i turn this off?

---

<div class="post-metadata">

**Author:** ![franzkaiser](https://avatars.discourse-cdn.com/v4/letter/f/67e7ee/32.png) [@franzkaiser](https://mangoh.discourse.group/u/franzkaiser)\
**Post date:** [February 18, 2020, 6:31am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780/4 "2020-02-18T06:31:15Z")

</div>

Also see: [https://mangoh.discourse.group/t/killswitch-demo-app/1194](https://mangoh.discourse.group/t/killswitch-demo-app/1194)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [February 18, 2020, 9:19am UTC](https://mangoh.discourse.group/t/compiling-killswitch-demo-for-mangoh-red/3780/5 "2020-02-18T09:19:02Z")

</div>

you need to do this:

Developer studio-\> Project Properties \> C/C++ Build \> Settings-\> mkapp Tool -\> C build option -\> Additional compiler option

add “-Wno-error=unused-const-variable=”

Also in killSwitch.cpp, comment out  
// LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::DISABLED);  
// LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_HOT);  
// LE\_DEBUG(“Changing state: %d-\>%d”, this-\>\_state, State::OPERATING\_NORMAL);
