pokitto / PokittoLib

Library for making programs on Pokitto hardware
22 stars 16 forks source link

building target is broken #29

Closed werton closed 6 years ago

werton commented 6 years ago

Hi. I ran in some problem. i can't build any targets (with Codeblocks & PokittoSim project) with last version of PokittoLib.

the building process ended with the following errors:

C:\Dev\pokitto\PokittoLib-master\Examples\HelloWorld\main.cpp||In function 'int SDL_main()':|
C:\Dev\pokitto\PokittoLib-master\Examples\HelloWorld\main.cpp|19|warning: no return statement in function returning non-void [-Wreturn-type]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoBattery.cpp|47|error: 'AnalogIn' does not name a type|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoBattery.cpp|50|error: 'BatLevelPin' was not declared in this scope|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoBattery.cpp|55|error: 'BatLevelPin' was not declared in this scope|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoConsole.cpp|287|warning: unused variable 'oldenable' [-Wunused-variable]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|393|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|484|warning: comparison between signed and unsigned integer expressions [-Wsign-compare]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|716|warning: unused variable 'counter' [-Wunused-variable]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|1014|warning: variable 'fc' set but not used [-Wunused-but-set-variable]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|1014|warning: variable 'bc' set but not used [-Wunused-but-set-variable]|
C:\Dev\pokitto\PokittoLib-master\Pokitto\POKITTO_CORE\PokittoCore.cpp|1047|warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]|
||=== Build finished: 3 error(s), 8 warning(s) (0 minute(s), 1 second(s)) ===|

But with previos version (21-02-2018) everything works well.

Pharap commented 6 years ago

This is because of this commit.

There are two potential solutions:

Pharap commented 6 years ago

@werton, can you please confirm whether this branch fixes the problem?

https://github.com/Pharap/PokittoLib/tree/fix-simulator-build

I've checked with both Code::Blocks and EmBitz and it seems to fix the problem.

I've got a PR ready (#30).