Loading...
 

System Workbench for STM32


Very strange problem extern "C" {} Does not work

g++ Not working properly

for example:

// a.h

  1. ifdef __cplusplus

extern “C” {

  1. endif

void a();

  1. ifdef __cplusplus

}

  1. endif


1:
// a.cpp

  1. include “a.h”

void a(){};

2:
// a.cpp

  1. include “a.h”

void extern “C” a(){};

1: a() is not available in GCC, 2: is available in GCC.

I do not know why?