Part Number: CCSTUDIO
Other Parts Discussed in Thread: CC1352P
Tool/software: Code Composer Studio
Hello -
I inherited an existing CCS Project which had source code in 'C' that was based on the CC13532P "Sensor" application. I wrote a single C++ class (within a interface file and implementation file pair) and added this to the project. A number of errors appeared which were unrelated to the syntax in the new source code, but rather appear to be related to the project not being configured properly for C++. I could use some help reconfiguring the project, hopefully not re-creating).
Errors that have appeared include:
1. The new source code includes <cstdint>. The preprocessor cannot find a symbol used in <cstdint>: #20 identifier _LIBCPP_BEGIN_NAMESPACE_STD is undefined.
2. None of the definitions which are listed in the "sensors.opts" file are provided to the compiler when processing the new C++ files. For example, "sensors.opts" includes this definition: "-DOSAL_PORT2TIRTOS". This macro is not defined when compiling the C++ file, but is defined when compiling the 'C' files.
The project build configuration is using TI compiler v20.2.3 LTS, which uses the "armcl" compiler capable of both C and C++.
Other posts on the E2E forum suggest Enabling the "Treat C files as C++ files" option under the project properties [ARM Compiler->Advanced Options->Language Options]. I tried this, but this caused a large number of compile errors in the existing 'C' code which have up until now compiled cleanly.
Lastly, in order to resolve as many of the compile errors as possible, I had to explicitly add the 2 new C++ files to the "File is a C++ file (default for .C .cpp .cc) (--cpp_file, -fp)" section of the project properties [ARM Compiler->Advanced Options->File Type Specifier]. Given that the armcl compiler is used for 'C' and C++, I would not think explicitly identification of the files would be necessary because the suffix on the file name would be a hint to the compiler as to the content within.
I am using CCS v10.1.1.00004. Project details include:
- Project is based on the CC1352P "Sensor" application.
- Build configurations are using the TI compiler v20.2.3 LTS
- Including XDCTools 3_61_02_27_core
- Including SimpleLink CC13x2/26x2 SDK 3_40_00_02
Thanks in advance for your thoughtful replies.
Jason