Other Parts Discussed in Thread: CC2652R7
Hello,
I am currently developing on the CC26x2R7 Launchpad and I am using IAR for ARM 8.50.9 and SDK 5.10.00.48. When working out of any project that uses TI's simplelink SDK, I am getting compilation errors when including certain headers (e.g. array.h) in my C++ files. For example, starting from the gpiointerrupt_LP_CC2652R7_tirtos_iar project, I've done the following:
- Renamed main_tirtos.c to main_tirtos.cpp
- Renamed gpiointerrupt.c to gpiointerrupt.cpp
- In main_tirtos.cpp, I added "#include <array>" where other header files are included:
/*
* ======== main_tirtos.cpp ========
*/
#include <stdint.h>
/* POSIX Header files */
#include <pthread.h>
/* RTOS header files */
#include <ti/sysbios/BIOS.h>
#include <ti/drivers/Board.h>
#include <array>
extern void *mainThread(void *arg0);
/* Stack size in bytes */
#define THREADSTACKSIZE 1024
/*
* ======== main ========
*/
int main(void)
{
pthread_t thread;
pthread_attr_t attrs;
struct sched_param priParam;
int retc;
Board_init();
/* Initialize the attributes structure with default values */
pthread_attr_init(&attrs);
/* Set priority, detach state, and stack size attributes */
priParam.sched_priority = 1;
retc = pthread_attr_setschedparam(&attrs, &priParam);
retc |= pthread_attr_setdetachstate(&attrs, PTHREAD_CREATE_DETACHED);
retc |= pthread_attr_setstacksize(&attrs, THREADSTACKSIZE);
if (retc != 0) {
/* failed to set attributes */
while (1) {}
}
retc = pthread_create(&thread, &attrs, mainThread, NULL);
if (retc != 0) {
/* pthread_create() failed */
while (1) {}
}
BIOS_start();
return (0);
}
Line 13 in the code snippet above causes compilation errors that seem to be completely unrelated to the array.h header:
These compilation errors only occur in TI's example projects. Just as a sanity check, I've created a new empty C++ project in IAR (so that nothing from the simplelink SDK is used), and I do not have compilation errors when i "#include <array>". I am able to use std::array functionality successfully.
So what in the TI simplelink SDK could be preventing me from being able to "#include <array>"?
Thanks,
Keron