This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/PROCESSOR-SDK-AM335X: NDK header file doesn't compile

Part Number: PROCESSOR-SDK-AM335X


Tool/software: Code Composer Studio

Hello,

I am getting an error when compiling a CPP file.

I have drilled it down to this.  This is a source file with no contents.  The header file "ti/drv/emac/src/v4/emac_drv_v4.h" is generating an error on line 138

Here are the entire contents of my source file:

/*
 * TestFile.cpp
 *
 *  Created on: Jul 24, 2017
 *      Author: me
 */

#include <ti/drv/emac/emac_drv.h>

#include <ti/drv/emac/src/v4/emac_drv_v4.h>

When CCS 7.2 compiles this, using the GNU 4.9.3 compiler, it generates this error:

'Building file: ../TestFile.cpp'
'Invoking: GNU Compiler'
"C:/ti/gcc-arm-none-eabi-4_9-2015q3/bin/arm-none-eabi-gcc.exe" -c -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -marm -mfloat-abi=hard

-Dam3359 -DSOC_AM335x -DBBB_AM335X -I"C:/Users/scott/workspace_v7/NIMU_BasicExample_bbbAM335x_armExampleproject"

-I"C:/ti/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include" -I"C:/ti/ndk_2_25_01_11/packages/ti/ndk/inc/bsd" -g -gdwarf-3

-gstrict-dwarf -Wall -c -MMD -MP -MMD -MP -MF"TestFile.d" -MT"TestFile.o" -o"TestFile.o" @"configPkg/compiler.opt"

"../TestFile.cpp"
subdir_rules.mk:16: recipe for target 'TestFile.o' failed
In file included from ../TestFile.cpp:12:0:
C:/ti/pdk_am335x_1_0_7/packages/ti/drv/emac/src/v4/emac_drv_v4.h:138:13: error: expected '}' at end of input
} EMAC_McbV4;

This exact location is the closing of a "typedef struct"  I cannot see any reason the compiler would complain about it, in either C or C++.

Does anyone know why this header file will not compile in C++, but will compile in straight C?

Thanks.

-CSW

  • I found the problem.

    In the file:   <ti/drv/emac/src/v4/emac_drv_v4.h>

    There is an opening

    #ifdef __cplusplus
    extern "C" {
    #endif

    However, there is no matching 

    #ifdef __cplusplus
    }
    #endif

    The compiler is stopping at the location where it expects the closing brace should fit.  I added that fragment myself to get it to compile.

    Can the team responsible for this please fix this header file?

    -CSW

  • Thanks for updating the thread.
  • Biser Gatchev-XID said:
    Thanks for updating the thread.

    You're welcome.
    You once asked me to identify where the team did not respond to a post...  Well this is one from last week which I am having to hack the TI headers in order to make it work:
    And I keep uncovering more issues with header files having conflicts.
    I now live in fear that the next update will overwrite things that I am having to hack up in order to get the TI provided materials to work properly.  And that it will set me back several days of work.
    -CSW