Windows & Linux Simulator repository on github

Hello all

A compiling and running linux sim is now up on github. Again, the library is a static lib at the moment: patience, the full source and other improvements are coming in not so distant future.

If linux users would be so kind as to clone & test to see if you can make it work.

Thanks!

Edit: some comments:

  • Ubuntu 14.04 LTS
  • Code::Blocks 13.12 (same version IS available for mac)
  • apt-get install libsdl2-dev
2 Likes

Success! Ran on the first try, I changed absolutely nothing.

Running Xubuntu 16.04 with the stock Code::Blocks, also 13.12.

1 Like

This is amazing news! Will try this and report back ASAP!

Edit: Hello World successfully built and running :slight_smile:

1 Like

Excellent! Thanks for testing.

Next things coming:

  • will add Windows target so we can maintain 1 repository
  • different graphics modes support
  • sound support

Windows target added. Just choose correct target inside Code::Blocks after you have opened the .cbp project file

2 Likes

Now that the simulator is on GitHub, any plans to use GitHub’s wiki pages for Pokitto’s API? Or will that be hosted elsewhere?

1 Like

I still want to see how I could use Doxygen to make my life easier. Github is a strong option for hosting the whole thing in the end.

1 Like

Yeah GitHub is great because the community it’s self can help build the pages. But generating the docs is always nice too.

Really can’t wait…

Hi! I am running same on Fedora 24 Gnome and CodeBlocks ver 16.01
getting this output when I am changing message in print()

output window is:

also when I try to build it it’s shows following error

How to resolve it??? Because to experiment we must have working thing !!!

1 Like

Hi

The min / max problem is a conflict between the fake_avr functions I use to make Arduino code run and the STL standard library. It now has reappeared on Linux because the random() function uses it.

Thanks for the bug report, I will fix this. It is not a big problem, just annoying.

Hi!

Please pull latest from repo & try again. With me (Ubuntu 14.04 LTS & Code::Blocks 13.12) everything works as is supposed to.

I am VERY new to c++ so I’m not sure if I’m doing something wrong. After working on a simple game I decided to try out vectors. I include vector to the top of my file and all of a sudden my math functions don’t work. The compiler says “min not declared in this scope”. Am I doing something wrong or is this an issue with the simulator?

Edit:
Basically, I can get vectors to work independently, I can get the math library independently. When I include both in the hello.cpp file the math library causes errors.

1 Like

I downloaded zip file from github again,but same error
Now on Fedora 25 and CodeBlocks 16.1

My point is that when I compile cpp file it’s compiled successfully but when I am going to build that project it’s shows same error to that function, How to successfully build that project?

Also when I am making some small changes on message in print function it dose not appear in output of simulator

1 Like

If do not build succesfully, the executable is not changed = you are running the original program again.

Please always copy-paste the code you are trying here. Then I can test your problem myself.

I am trying to get the same problem to appear as you.

@trelemar @krp

Quick explanation of what is the problem & how to fix. Better explanation coming later.

Problem cause: min max functions are defined in two different places. Standard C library (algorithm.h) and in my library in fake_avr.h

The fake_avr.h definition for min/max is needed for compatibility with Arduino-based code. The problem is that the Arduino version (or actually AVR) is not compatible with C statndard library version

Problem solution: choose what min/max your project uses

1. to use standard C lib version of min/max

Project->Build options->Compiler settings->#defines

add this to end of definitions:

DISABLEAVRMIN

(this is a safety device I added exactly because I knew this problem might appear)

Then add

#include <math.h>
#include <algorithm>

2. to use AVR min/max

Do not put DISABLEAVRMIN in your project options.
Do not use standard C library math algorithms

1 Like

Thank you for the explanation. The problem makes alot of sense now. I was just unsure if I was doing something wrong in my code. If we use these standard math functions in our code that aren’t supported by Arduino, the game won’t run on real hardware correct?