Must specify a board to use with native framework


I’m trying to build a small native Win32 application using VSCode and PIO.

When building the project PIO outputs this error:
“Please specify board in platformio.ini to use with ‘native’ framework”

From the very extensive documentation I have found that you do not have to specify a board when using the ‘native’ framework.
Am I overlooking something here?

Other info

  • All requirements have been installed (Mingw, gcc is working, etc)

  • My platformio.ini file:

     platform = windows_x86
     framework = native
     ;build_flags = -std=gnu++11
  • PIO output:

Processing MyWindowsApp (platform: windows_x86; framework: native)

Verbose mode can be enabled via -v, --verbose option

  • toolchain-gccmingw32 @ 1.50100.0 (5.1.0)
    Please specify board in platformio.ini to use with ‘native’ framework
    ==== [FAILED] Took 0.86 seconds ===
  • The terminal process “C:\Users\user.platformio\penv\Scripts\platformio.exe ‘run’, ‘–environment’, ‘MyWindowsApp’” terminated with exit code: 1.

Thank you!!

This error is telling you to remove the framework = ... directive. As for platform = native, the platform = windows_x86 features no selectable framework. You can see that in the given reference project

Thank you maxgerhardt!

This has solved my issue.

I misinterpreted the documentation at GitHub - platformio/platform-windows_x86 at master
which shows this configuration:

platform = windows_x86
board = …

Best regards!

Bad docs. I’ve filed a PR to correct them here.