2017-01-08 22 views
6

질문은 arm-none-eabi-g ++ 6.2 및 newlib-nano와의 연결을 의미합니다. I는 -specs=nano.specsC 소스을 사전 처리는g ++ 및 specs-file을 사용한 전처리

디렉토리에서 파일 newlib-nanonewlib.h 포함되어

echo '#include <string.h>' |\ 
/opt/gcc-arm-none-eabi-6_2-2016q4/bin/arm-none-eabi-gcc -specs=nano.specs -x c -E - |\ 
grep '^# 1 .*newlib\.h' 

출력 (예상) # 1 "/opt/gcc-arm-none-eabi-6_2-2016q4/arm-none-eabi/include/newlib-nano/newlib.h" 1 3 4. 파일 nano.specs이 라인

%rename cpp  nano_cpp 
  
*cpp: 
-isystem =/include/newlib-nano %(nano_cpp) 

(다른 사람의 사이에서)이 포함되어 있기 때문입니다하지만이 C++ 공급하는 경우 - 같은 컴파일러

echo '#include <string.h>' |\ 
/opt/gcc-arm-none-eabi-6_2-2016q4/bin/arm-none-eabi-gcc -specs=nano.specs -x c++ -E - |\ 
grep '^# 1 .*newlib\.h' 

을 통해 소스를 출력 # 1 "/opt/gcc-arm-none-eabi-6_2-2016q4/arm-none-eabi/include/newlib.h" 1 3을 읽습니다.

다른 말로하면 : specs-file은 무시됩니다.

은 내가 C++ 소스에서 <cstring> 대신 <string.h>을 포함 GNU의 g의 ++ 일반적 …/arm-none-eabi-c++ 대신 …/arm-none-eabi-gcc -x c++ 호출하지만 난 작은 차이를 개척하는 것을 한 것을해야한다고 알고 있습니다. 그리고 이것은 문제를 바꾸지 않습니다.

질문 : C++ 파일에 newlib-nano/newlib.h이 포함되도록하려면 사양 파일에 무엇을 추가해야합니까?

답변