Does modus toolbox 2.1 support c++

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiBi_4539931
Level 1
Level 1
5 replies posted 5 questions asked First question asked

Hi.

I recently moved from Modus Toolbox 1.1 to 2.1. I must say it is much easier to use, however I have problems with adding .cpp files. I never tried that with 1.1 version.

So I took an example bt empty application. After setuping SDK I was able to build that example application. I wanted then to test if .cpp files are supported – I think they weren’t supported for Modus Toolbox 1.1. I just added very basic .cpp file in example directory. Modus Toolbox autodetected my file and tried to compile but I am getting an error when compiling:

C:/Program Files (x86)/mingw-w32/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x39): undefined reference to `WinMain@16'

collect2.exe: error: ld returned 1 exit status

make[1]: *** [../../../wiced_btsdk/dev-kit/baselib/20819A1/make/core/build.mk:350: C:/*/mt/mtb-examples-CYW920819EVB-02-btsdk-empty_4/template/empty_wiced_bt/build/CYW920819EVB-02/Debug/dummy.o] Error 1

make[1]: *** Waiting for unfinished jobs....

make: *** [../../../wiced_btsdk/dev-kit/baselib/20819A1/make/core/main.mk:350: secondstage] Error 2

  "C:/Users/THINK/ModusToolbox2.1.0/tools_2.1/modus-shell/bin/make CY_MAKE_IDE=eclipse CY_IDE_TOOLS_DIR=C:/Users/THINK/ModusToolbox2.1.0/tools_2.1 -j8 all" terminated with exit code 2. Build might be incomplete.

I tried to go through Makefile rules, but it is quite complex. Can you guide me how to properly add .cpp file to my project? Or maybe it is not yet supported? What would be alternative then ?

Michal

0 Likes
1 Solution

Hi MiBi_4539931 ,

Sorry C++ is not supported for the BTSDK chips like CYW20819.

Regards,

Anjana

View solution in original post

3 Replies
lock attach
Attachments are accessible only for community members.
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi MiBi_4539931​,

I think you are facing this issue because the dummy.o which is the .o file for dummy.c file has not been deleted. Can you delete all the contents of the build folder and compile the program again?

This is what I did -

1. Create an empty project application.

2. Deleted contents of build folder (if present).

3. Changed main.c file to main.cpp

4. Used the scope resolution operator just to test. I have attached the main.cpp file for reference.

5. Build and program the device.

Please let me know if this helps.

Thanks and Regards,

Rakshith M B

Thanks and Regards,
Rakshith M B

Hi RakshithM_16 ,

Thank you for the response. I think you are refering to PSOC project while I am using CYW920819EVB-02. Can you try creating project for that board and see if C++ will work for you there? If so can you share whole project?

Best regards,

Michal

0 Likes

Hi MiBi_4539931 ,

Sorry C++ is not supported for the BTSDK chips like CYW20819.

Regards,

Anjana