MCUXPRESSO C++ Project Using std Namespace

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MCUXPRESSO C++ Project Using std Namespace

1,416 次查看
pwhittin
Contributor I

With MCUXPRESSO create a C++ project with access to the 'std' name space

I've followed the 'File -> New -> Project' wizard, accepted all defaults, and created a C++ project with MCUXPRESSO version mcuxpressoide-10.1.1_606 named 'LPC54608J512_Project'.  The project generated compiles, and links without error.

I then replace the blank line 44 with:

std::size_t haha = 0;

and compiling fails with the following error:

../source/LPC54608J512_Project.cpp:44:6: error: 'size_t' in namespace 'std' does not name a type

Any ideas?

1 回复

1,280 次查看
pwhittin
Contributor I

I figured it out!  One must include:

#include <cstddef>