cancel
Showing results for 
Search instead for 
Did you mean: 

WICED Studio Wi-Fi Combo

BaT_3785171
New Contributor II

I added MyCode.cpp to this path 43xxx_Wi-Fi\apps\snip\scan.

Contents of MyCode.cpp is as follows.

/************start of MyCode.cpp************/

#include "wiced.h"

/************End of MyCode.cpp************/

Contents of scan.mk is as follows.

NAME := App_Scan

$(NAME)_SOURCES := scan.c

$(NAME)_SOURCES += MyCode.cpp

While compiling following error is coming.

pastedImage_0.png

Why this error ?

As per my understanding compilation should happen successfully.

0 Likes
1 Solution
ToLa_2193696
New Contributor II

Hi,

I successfully use wiced in a c++11 project. However, out of the box I ran into compilation issues as well.

One header file has an unbalanced extern "C" block. Try to fix that first and compile again.

WICED/security/BESL/host/WICED/tls_types.h

pastedImage_0.png

I also had to make some changes to the file

tools/makefiles/wiced_toolchain_ARM_GNU.mk

among others added a -std=c++11 -Wno-literal-suffix

COMPILER_SPECIFIC_STANDARD_CXXFLAGS = -Wall -fsigned-char -ffunction-sections -fdata-sections -fno-common -fno-rtti -fno-exceptions -fdiagnostics-color -std=c++11 -Wno-literal-suffix  $(if $(filter yes,$(CYPRESS_INTERNAL) $(TESTER)),-Werror)

Please see the attached files

View solution in original post

3 Replies
RaktimR_11
Moderator
Moderator

I don't receive this error when trying to reproduce the exact same scenario. Looks like there is a '}' missing in wiced.h from the error log in your case. Please replace the wiced.h with the attached one and the error should go away.

ToLa_2193696
New Contributor II

Hi,

I successfully use wiced in a c++11 project. However, out of the box I ran into compilation issues as well.

One header file has an unbalanced extern "C" block. Try to fix that first and compile again.

WICED/security/BESL/host/WICED/tls_types.h

pastedImage_0.png

I also had to make some changes to the file

tools/makefiles/wiced_toolchain_ARM_GNU.mk

among others added a -std=c++11 -Wno-literal-suffix

COMPILER_SPECIFIC_STANDARD_CXXFLAGS = -Wall -fsigned-char -ffunction-sections -fdata-sections -fno-common -fno-rtti -fno-exceptions -fdiagnostics-color -std=c++11 -Wno-literal-suffix  $(if $(filter yes,$(CYPRESS_INTERNAL) $(TESTER)),-Werror)

Please see the attached files

View solution in original post

RaktimR_11
Moderator
Moderator

Thanks a lot for your valued suggestions. One more thing I wanted to add which might look obvious: If you are trying to run

int run_test(int argc, char **argv) for a .cpp file, replace the same thing with extern "C" int run_test(int argc, char **argv) for successfully compiling a .cpp code.