Problems compiling with PlatformIO


#1

I was curious to give a look at the code and test PlatformIO.
For some reason it can’t compile correctly. Output complains about c++11 identifier not recognized and first error is

src\main.cpp:21:23: error: 'GameState' is not a class or namespace

That let me think that for some reason PlatformIO is not recognizing some of the build flag directives?

build_flags = -DPOKITTO_PIO_BUILD -Isrc -std=c++11

Any tips?


Pokitto Ware Factory idea
Pokitto::Code::Blocks
#2

First tip: try putting the separate flags on their own lines. There was something funky about the way Platformio parses the ini files.


#3

To quote the documentation:

Multi-values option could be specified in 2 ways:

  1. Split values with “, ” (comma + space)
  2. Use multi-line format, where each new line should start with 2 spaces (minimum)

#4

Try with both but same result. Start with a blank project and minimal main. Just to test platformIO has been installed correctly. It compile correctly.

Back to @Pharap instructions to include the master branch but same results.

> Executing task: C:\Users\Filippo\.platformio\penv\Scripts\platformio.exe run <

Processing lpc11u68 (platform: nxplpc; board: lpc11u68; framework: mbed)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
Comparing startup_LPC11U68.cpp to PokittoLib repository...
Comparing linker file LPC11U68.ld to PokittoLib repository...
PLATFORM: NXP LPC > LPCXpresso11U68
SYSTEM: LPC11U68 50MHz 36KB RAM (256KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 26 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <mbed-mbedtls>
|-- <Pokitto> 0.0.1
Compiling .pioenvs\lpc11u68\src\main.o
src\main.cpp:57:1: warning: identifier 'constexpr' is a keyword in C++11 [-Wc++11-compat]
constexpr int menuSelectionMin = 0;
^~~~~~~~~
Compiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoBattery.o
Compiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoButtons.o
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
In file included from src\main.cpp:6:0:
src\GameState.h:5:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11
enum class GameState
^~~~
src\main.cpp:20:23: error: 'GameState' is not a class or namespace
GameState gameState = GameState::MainMenu;
^~~~~~~~~
src\main.cpp: In function 'int main()':C
ompiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoConsole.osrc\main.cpp:40:10: error: 'GameState' is not a class or namespace

case GameState::MainMenu:
^~~~~~~~~
src\main.cpp:44:10: error: 'GameState' is not a class or namespace
case GameState::SortingGame:
^~~~~~~~~
src\main.cpp:48:10: error: 'GameState' is not a class or namespace
case GameState::Game2:
^~~~~~~~~
src\main.cpp:38:10: warning: enumeration value 'MainMenu' not handled in switch [-Wswitch]
switch(gameState)
^
src\main.cpp:38:10: warning: enumeration value 'SortingGame' not handled in switch [-Wswitch]
src\main.cpp:38:10: warning: enumeration value 'Game2' not handled in switch [-Wswitch]
src\main.cpp: At global scope:
src\main.cpp:57:1: error: 'constexpr' does not name a type; did you mean 'constrain'?
constexpr int menuSelectionMin = 0;
^~~~~~~~~
constrain
src\main.cpp:57:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
src\main.cpp:58:1: error: 'constexpr' does not name a type; did you mean 'constrain'?
constexpr int menuSelectionMax = 1;
^~~~~~~~~
constrain
src\main.cpp:58:1: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
src\main.cpp: In function 'void updateMainMenu()':
src\main.cpp:72:22: error: 'menuSelectionMin' was not declared in this scope
if(menuSelection > menuSelectionMin)
^~~~~~~~~~~~~~~~
src\main.cpp:72:22: note: suggested alternative: 'menuSelection'
if(menuSelection > menuSelectionMin)
^~~~~~~~~~~~~~~~
menuSelection
src\main.cpp:84:22: error: 'menuSelectionMax' was not declared in this scope
if(menuSelection < menuSelectionMax)
^~~~~~~~~~~~~~~~
src\main.cpp:84:22: note: suggested alternative: 'menuSelection'
if(menuSelection < menuSelectionMax)
^~~~~~~~~~~~~~~~
menuSelection
src\main.cpp:98:17: error: 'GameState' is not a class or namespace
gameState = GameState::SortingGame;
^~~~~~~~~
src\main.cpp:101:17: error: 'GameState' is not a class or namespace
gameState = GameState::Game2;
^~~~~~~~~
src\main.cpp: At global scope:
src\main.cpp:108:1: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
{
^
src\main.cpp: In function 'void renderMainMenu()':
src\main.cpp:117:14: error: 'menuSelectionMin' was not declared in this scope
for(int i = menuSelectionMin; i <= menuSelectionMax; ++i)
^~~~~~~~~~~~~~~~
src\main.cpp:117:14: note: suggested alternative: 'menuSelection'
for(int i = menuSelectionMin; i <= menuSelectionMax; ++i)
^~~~~~~~~~~~~~~~
menuSelection
src\main.cpp:117:37: error: 'menuSelectionMax' was not declared in this scope
for(int i = menuSelectionMin; i <= menuSelectionMax; ++i)
^~~~~~~~~~~~~~~~
src\main.cpp:117:37: note: suggested alternative: 'menuSelection'
for(int i = menuSelectionMin; i <= menuSelectionMax; ++i)
^~~~~~~~~~~~~~~~
menuSelection
src\main.cpp: At global scope:
src\main.cpp:132:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11
enum class Symbol
^~~~
src\main.cpp: In function 'void handleHitAction()':
src\main.cpp:152:8: error: 'Symbol' is not a class or namespace
case Symbol::Tingle:
^~~~~~
src\main.cpp:155:8: error: 'Symbol' is not a class or namespaceC
ompiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoCookie.ocase Symbol::Navi:

^~~~~~
src\main.cpp:158:8: error: 'Symbol' is not a class or namespace
case Symbol::Cuccoo:
^~~~~~
src\main.cpp:150:8: warning: enumeration value 'Tingle' not handled in switch [-Wswitch]
switch(currentSymbol)
^
src\main.cpp:150:8: warning: enumeration value 'Navi' not handled in switch [-Wswitch]
src\main.cpp:150:8: warning: enumeration value 'Cuccoo' not handled in switch [-Wswitch]
src\main.cpp: In function 'void handlePassAction()':
src\main.cpp:168:8: error: 'Symbol' is not a class or namespace
case Symbol::Tingle:
^~~~~~
src\main.cpp:171:8: error: 'Symbol' is not a class or namespace
case Symbol::Navi:
^~~~~~
src\main.cpp:174:8: error: 'Symbol' is not a class or namespace
case Symbol::Cuccoo:
^~~~~~
src\main.cpp:166:8: warning: enumeration value 'Tingle' not handled in switch [-Wswitch]
switch(currentSymbol)
^
src\main.cpp:166:8: warning: enumeration value 'Navi' not handled in switch [-Wswitch]
src\main.cpp:166:8: warning: enumeration value 'Cuccoo' not handled in switch [-Wswitch]
src\main.cpp: In function 'void updateSortingGame()':
src\main.cpp:208:16: error: 'GameState' is not a class or namespace
gameState = GameState::MainMenu;
^~~~~~~~~
src\main.cpp: In function 'void renderSortingGame()':
src\main.cpp:227:9: error: 'Symbol' is not a class or namespace
case Symbol::Tingle:
^~~~~~
src\main.cpp:230:9: error: 'Symbol' is not a class or namespace
case Symbol::Navi:
^~~~~~
src\main.cpp:233:9: error: 'Symbol' is not a class or namespace
case Symbol::Cuccoo:
^~~~~~
src\main.cpp:225:9: warning: enumeration value 'Tingle' not handled in switch [-Wswitch]
switch(currentSymbol)
^
src\main.cpp:225:9: warning: enumeration value 'Navi' not handled in switch [-Wswitch]
src\main.cpp:225:9: warning: enumeration value 'Cuccoo' not handled in switch [-Wswitch]
src\main.cpp: In function 'void updateGame2()':
src\main.cpp:247:15: error: 'GameState' is not a class or namespace
gameState = GameState::MainMenu;
^~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src/Pokitto.h:50:0,
from src\main.cpp:2:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h: At global scope:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h:144:20: warning: 'EEPROM' defined but not used [-Wunused-variable]
static EEPROMClass EEPROM;
^~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src/PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src/PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src/PokittoCore.h:57,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src/Pokitto.h:41,
from src\main.cpp:2:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
Compiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoCore.o
Compiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoDisk.o
*** [.pioenvs\lpc11u68\src\main.o] Error 1
Compiling .pioenvs\lpc11u68\lib1b3\Pokitto_ID5600\PokittoDisplay.o
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoBattery.h:44,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoBattery.cpp:37:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.h:57,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoButtons.cpp:37:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoConsole.cpp:37:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp: In member function 'bool Pokitto::Cookie::saveCookie()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp:129:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp: In member function 'bool Pokitto::Cookie::loadCookie()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp:138:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp: In static member function 'static int Pokitto::Core::updateLoader(uint32_t, uint32_t)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp:183:9: warning: variable 'opg' set but not used [-Wunused-but-set-variable]
int opg=-1;
^~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp: In static member function 'static void Pokitto::Core::jumpToLoader()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp:279:45: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
if (fileOpen("LOA.DER", FILE_MODE_BINARY)==0) {
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp: In member function 'int Pokitto::Cookie::findMyNextBlock()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp:361:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\Pokitto.h:50:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp:38:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h: At global scope:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h:144:20: warning: 'EEPROM' defined but not used [-Wunused-variable]
static EEPROMClass EEPROM;
^~~~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp:274:14: warning: unused variable 'bootversion' [-Wunused-variable]
uint32_t bootversion=0, sdversion=0, sdjump=0;
^~~~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.h:57,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\Pokitto.h:41,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCookie.cpp:38:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.h:57,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.cpp:38:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h: At global scope:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
cc1plus.exe: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'void emptyFname()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:79:43: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
for (int i=0; i<13; i++) fno.fname[i]=NULL;
^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'char* getNextFile(char*)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:152:27: warning: NULL used in arithmetic [-Wpointer-arith]
if (fno.fname[0]==NULL) return NULL; //end of files
^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'char* getNextFile()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:162:26: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
return getNextFile("");
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'char* getFirstFile(char*)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:181:27: warning: NULL used in arithmetic [-Wpointer-arith]
if (fno.fname[0]==NULL) break; //end of directory reached, no files found
^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'char* getFirstFile()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:188:27: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
return getFirstFile("");
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'char fileGetChar()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:229:9: warning: unused variable 'err' [-Wunused-variable]
int err = PFFS::pf_read(buff, 1, &br);    /* Read data to the buff[] */
^~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'void fileSeekRelative(long int)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:256:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (n<0) if (fs.fptr < -n) n=-fs.fptr;
~~~~~~~~^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:256:8: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
if (n<0) if (fs.fptr < -n) n=-fs.fptr;
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp: In function 'int fileReadLine(char*, int)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:289:15: warning: NULL used in arithmetic [-Wpointer-arith]
while (c!=NULL) {
^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:295:52: warning: converting to non-pointer type 'char' from NULL [-Wconversion-null]
if (c=='\n' || c=='\r' || n==maxchars-1) c=NULL; //prevent buffer overflow
^~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp: In static member function 'static int Pokitto::Display::bufferChar(int16_t, int16_t, uint16_t)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:499:39: warning: narrowing conversion of 'Pokitto::Display::bgcolor' from 'uint16_t {aka short unsigned int}' to 'uint8_t {aka unsigned char}' inside { } is ill-formed in C++11 [-Wnarrowing]
uint8_t colors[] = {bgcolor, color};
^
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:499:39: warning: narrowing conversion of 'Pokitto::Display::color' from 'uint16_t {aka short unsigned int}' to 'uint8_t {aka unsigned char}' inside { } is ill-formed in C++11 [-Wnarrowing]
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp: In static member function 'static void Pokitto::Display::clear()':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:564:55: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
if ((bgcolor>>1) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME,0xFF,j);// G
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:565:36: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
else memset((void*)m_scrbuf+POK_BITFRAME,0x00,j);// G
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:566:55: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
if ((bgcolor>>2) & 0x1) memset((void*)m_scrbuf+POK_BITFRAME*2,0xFF,j);// B
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:567:36: warning: pointer of type 'void *' used in arithmetic [-Wpointer-arith]
else memset((void*)m_scrbuf+POK_BITFRAME*2,0x00,j);// B
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\Pokitto.h:50:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:21:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h: At global scope:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/PokittoEEPROM.h:144:20: warning: 'EEPROM' defined but not used [-Wunused-variable]
static EEPROMClass EEPROM;
^~~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoCore.h:57,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\Pokitto.h:41,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisk.cpp:21:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp: In static member function 'static void Pokitto::Display::drawBitmapData(int16_t, int16_t, int16_t, int16_t, const uint8_t*)':
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:1463:32: warning: variable 'bitNum' set but not used [-Wunused-but-set-variable]
int16_t i, j, byteNum, bitNum, byteWidth = (w + 7) >> 3;
^~~~~~
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:1563:20: warning: variable 'xclip' set but not used [-Wunused-but-set-variable]
int16_t scrx,scry,xclip,xjump,scrxjump;
^~~~~
In file included from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoGlobs.h:48:0,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.h:73,
from C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\PokittoDisplay.cpp:67:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h: At global scope:
C:\Users\Filippo\.platformio\lib\Pokitto_ID5600\src\hal\LPC11U68/HWLCD.h:163:13: warning: 'void Pokitto::setup_gpio()' defined but not used [-Wunused-function]
static void setup_gpio()
^~~~~~~~~~
====================================================================== [ERROR] Took 6.70 seconds ======================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Gamestate.h is present in the src folder


#5

#6
PS C:\Users\Filippo\Documents\PlatformIO\Projects\PIO> pio upgrade --dev
Please wait while upgrading PlatformIO ...
PlatformIO has been successfully upgraded to 3.6.0
Release notes: http://docs.platformio.org/en/latest/history.html
PS C:\Users\Filippo\Documents\PlatformIO\Projects\PIO>

But same result…


#7

the code compiles just fine like it did before, but the squiggle still appear even if i restart vscode, from what i can see the file c_cpp_properties.json is regenerated at startup, still with the wrong flag

Can you check the c_cpp_properties.json?


#8

Are you using the platform.ini that I provided in the repo?


#9

c_cpp_properties.json seems to recompile when you restart VS code with:

"cStandard": "c99",
"cppStandard": "c++98",

Modify that entries by hand seems to have no effect.
Also tried with pio init --ide=vscode but same.
I’m preparing to use that special emoticons… :wink:
But step back, @Pharap compiled it… so it must


#10

Exactly the same


#11

Yet another bug in Platformio is my guess


#12

Can you post your platform.ini somewhere? E.g. in a gist?


I just downloaded a fresh copy of the repo and set up a blank project and used the repo files to overwrite the project files.
It worked seamlessly for me.
If in doubt, nuke everything and try again:

  1. Press the home button to bring up platformio home
  2. Create new project called ‘HodadsMinigames’ using LPCXpresso11U68
  3. Open the ‘HodadsMinigames’ project folder
  4. Grab a .zipof from the repo
  5. Extract the .zip
  6. Copy everything from inside the folder within the .zip to the project directory so that platformio.ini and pokitto_pre.py are overwritten
  7. Open the project folder in VSCode using ‘OpenFolder…’
  8. Open main.cpp
  9. Press F1 to bring up tasks
  10. Find PlatformIO: Build
  11. Run the task

#13
; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; http://docs.platformio.org/page/projectconf.html

[env:lpc11u68]
platform = nxplpc
board = lpc11u68
framework = mbed
build_flags =
  -DPOKITTO_PIO_BUILD
  -Isrc
  -std=c++11
extra_scripts = pre:pokitto_pre.py

platformio.ini (523 Bytes)

Now I’ll start again from scratch:
Same:


#14

That is indeed strange.
The only way I can get my copy to do that is by deleting the -std=c++11 from platform.ini.

Which OS are you using?
Have you tried nuking the PokittoLib and reinstalling it?


#15

Win10 Home.
I’m using usb-portable version of VsCode. Going to full install standard version.


#16

Installed standard VS code , reinstalled PlatformIO and PokittoLib.
Started from a C working solution single minimal main.c. Add -std=c++11 to platformio.ini. Close and reopen VSCode.
It compile again the same till add an c++ expression like
constexpr int test = 0;
Then same output.
Can you post your c_cpp_properties.json @Pharap? Mainly last section:

            "intelliSenseMode": "clang-x64",
            "cStandard": "c99",
            "cppStandard": "c++98",
            "compilerPath": "C:/Users/Filippo/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe"

#17
            "intelliSenseMode": "clang-x64",
            "cStandard": "c99",
            "cppStandard": "c++11",
            "compilerPath": "C:/Users/<me>/.platformio/packages/toolchain-gccarmnoneeabi/bin/arm-none-eabi-gcc.exe"

Make sure it’s main.cpp and not main.c, if you try to use .c anywhere the compiler will go into C mode and won’t recognise constexpr anyway.


#18

Just a typo. It’s cpp.


#19

@HomineLudens

try this: open LPC11U68.json and put the C++11 flag right into it

it can be found in

.platformio/packages/framework-mbed/platformio/variants/LPC11U68


#20

Bad Boy! That’s work.
I now have:

 "cxx": [
            "-std=c++11", 
            "-fno-rtti", 
            "-Wvla"
        ], 

and that’s made the trick. Thanks for help.


Pokitto::Code::Blocks