5 Replies Latest reply on Nov 15, 2016 12:23 AM by marmottus

    Compile a C++ file

    marmottus

      Is there a way to compile a C++ file in the Wiced SDK ? I tried a simple application test that includes and I get a lot of errors.

      I tried on macOS and Linux and the errors are the same. Any idea ?

       

      Thank you

       

      ./tools/ARM_GNU/bin/Linux64/../../include/bits/memoryfwd.h:63:3: error: template with C linkage
         template<typename>
         ^
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/memoryfwd.h:66:3: error: template specialization with C linkage
         template<>
         ^
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/memoryfwd.h:70:3: error: template with C linkage
         template<typename, typename>
         ^
      In file included from ./tools/ARM_GNU/bin/Linux64/../../include/string:39:0,
                       from apps/snip/foo/foo.cpp:1:
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/stringfwd.h:52:3: error: template with C linkage
         template<class _CharT>
         ^
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/stringfwd.h:55:3: error: template with C linkage
         template<typename _CharT, typename _Traits = char_traits<_CharT>,
         ^
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/stringfwd.h:59:3: error: template specialization with C linkage
         template<> struct char_traits<char>;
         ^
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/stringfwd.h:65:3: error: template specialization with C linkage
         template<> struct char_traits<wchar_t>;
         ^
      In file included from ./tools/ARM_GNU/bin/Linux64/../../include/bits/stl_algobase.h:61:0,
                       from ./tools/ARM_GNU/bin/Linux64/../../include/bits/char_traits.h:39,
                       from ./tools/ARM_GNU/bin/Linux64/../../include/string:40,
                       from apps/snip/foo/foo.cpp:1:
      ./tools/ARM_GNU/bin/Linux64/../../include/bits/cpp_type_traits.h:72:3: error: template with C linkage
         template<typename _Iterator, typename _Container>
         ^
      
        • 1. Re: Compile a C++ file
          darius1

          Which sdk version you used?

          With 3.5.2 no problems. With 3.7.0 was problem in makefile. Need do some correction.

          • 2. Re: Compile a C++ file
            marmottus

            Hi darius1

             

            I am using the SDK 4.0.0 and my CPU is a Cortex R4.

             

            Thank you    

            • 3. Re: Compile a C++ file
              darius1

              I not interesting in wiced4, because removed support for freertos-lwip. But think, that same makefile bug, like 3.7.0 ...   I am not at workplace, so what need change, i will append later.

              • 4. Re: Compile a C++ file
                darius1

                Try  in  sdk3.7.0 (looks same in 4.0) file  WICED-SDK\tools\makefiles\wiced_toolchain_ARM_GNU.mk

                make small change  add COMPILER_SPECIFIC_SYSTEM_DIR_CXX and change CXX

                 

                ifeq ($(COMPILER_SPECIFIC_SYSTEM_DIR),)

                COMPILER_SPECIFIC_SYSTEM_DIR := -isystem $(TOOLCHAIN_PATH)../../include -isystem $(TOOLCHAIN_PATH)../../lib/include -isystem $(TOOLCHAIN_PATH)../../lib/include-fixed

                COMPILER_SPECIFIC_SYSTEM_DIR_CXX := $(TOOLCHAIN_PATH)../../include $(TOOLCHAIN_PATH)../../lib/include $(TOOLCHAIN_PATH)../../lib/include-fixed

                endif

                 

                CC       = "$(TOOLCHAIN_PATH)$(TOOLCHAIN_PREFIX)gcc$(EXECUTABLE_SUFFIX)" $(COMPILER_SPECIFIC_SYSTEM_DIR)

                CXX      = "$(TOOLCHAIN_PATH)$(TOOLCHAIN_PREFIX)g++$(EXECUTABLE_SUFFIX)" $(COMPILER_SPECIFIC_SYSTEM_DIR_CXX)

                 

                This change help compile C++ files for us.

                Can wiced team approve this fix?

                3 of 3 people found this helpful
                • 5. Re: Compile a C++ file
                  marmottus

                  Thank you so much darius1, that does it !

                  1 of 1 people found this helpful