Hi everyone,
I’m trying to implement a small C++ sample but get the following error when building the app:
mkapp -t wp76xx helloCPP.adef
[1/1] Regenerating build script
[3/9] Compiling C++ source
FAILED: _build_helloCPP/wp76xx/component/b130cd0656327c8de99a44179d5831dc/obj/4c01286321aa8b611d1cea84c8618f67.o
/home/mangoh/workspace/leaf-data/wp76stable/wp76-toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ --sysroot=/home/mangoh/workspace/leaf-data/wp76stable/wp76-toolchain/sysroots/armv7a-neon-poky-linux-gnueabi -MMD -MF _build_helloCPP/wp76xx/component/b130cd0656327c8de99a44179d5831dc/obj/4c01286321aa8b611d1cea84c8618f67.o.d -c /home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp -o _build_helloCPP/wp76xx/component/b130cd0656327c8de99a44179d5831dc/obj/4c01286321aa8b611d1cea84c8618f67.o -DLE_FILENAME=basename /home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp
-Wall -fPIC -Werror -fvisibility=hidden -DMK_TOOLS_BUILD -DLEGATO_EMBEDDED -I ./_build_helloCPP/wp76xx -I/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/interfaces -I/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/framework/include -I/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP -I./_build_helloCPP/wp76xx/component/b130cd0656327c8de99a44179d5831dc/src -DLE_COMPONENT_NAME=helloCPPComponent -DLE_LOG_SESSION=helloCPPComponent_LogSession -DLE_LOG_LEVEL_FILTER_PTR=helloCPPComponent_LogLevelFilterPtr “-DCOMPONENT_INIT=LE_CI_LINKAGE LE_SHARED void _helloCPPComponent_COMPONENT_INIT()”
:0:16: error: ‘LE_CI_LINKAGE’ does not name a type; did you mean ‘LE_FILENAME’?
/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp:7:1: note: in expansion of macro ‘COMPONENT_INIT’
COMPONENT_INIT{
^~~~~~~~~~~~~~
/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp: In function ‘int greet()’:
/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp:11:5: error: ambiguating new declaration of ‘int greet()’
int greet() {
^~~~~
/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp:5:6: note: old declaration ‘void greet()’
void greet(void);
^~~~~
/home/mangoh/workspace/leaf-data/wp76stable/fx30-cat1-legato/apps/helloCPP/helloCPPComponent/helloCPP.cpp:14:1: error: no return statement in function returning non-void [-Werror=return-type]
}
^
cc1plus: all warnings being treated as errors
#include <iostream>
using namespace std;
void greet(void);
COMPONENT_INIT{
greet();
}
void greet() {
cout << "Hello World!";
return;
}
What am I doing wrong? Any help is greatly appreciated.