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)
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.
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.
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?
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
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?