Keil uVision4 を使用して STM32F2 デバイスで開発しています。私は C++ を使用しようとしていますが、これは uVision ツールチェーンで提供されている armcc (間違っている場合は訂正してください) で使用できるはずです。しかし、uVision は標準の C++ インクルード方法を受け入れることを拒否します
#include <cstdint>
動作しません
#include <stdint.h>
完璧に動作します。uVision 内で cstdint を開くと (右クリックしてドキュメントを開く)、ファイルが開かれますが、ヘッダー ファイルではなく、派手な色のない汎用ファイルとして開かれます。
私は何が欠けていますか?両方のファイルは同じフォルダ C:\Keil\ARM\ARMCC\include にあり、(--cpp を追加して) コンパイラに強制的に c++ を使用させるかどうかに違いはありません。uVision は末尾のないファイルをヘッダー ファイルとして受け入れることができないのですか?
編集:回答に応じて(お時間をいただきありがとうございます!):エラーメッセージは次のようになります。
#include <cstdint> and
#include <cstdint.h>
typedef uint32_t u32;
error: #20: identifier uint32_t is undefined
その間
#include <stdint.h> and
#include <stdint>
typedef uint32_t u32;
and
#include <cstdint>
typedef std::uint32_t u32;
works perfectly.
問題が何であるかを示します。ご協力ありがとうございました!