enum class is not a class unless it’s -std=c++11


As I progress through the C++ course at Udemy, I’ve just completed section 4. However, I ran into a few snags along the way. Some of them are due to differences between the instructor using Windows, and me using Linux. Most notably, I ran into a complete showstopper that took me a while to figure out, so I’ll share it here.

g++ -Wall -c “Timber.cpp”
Timber.cpp:17:1: warning: scoped enums only available with -std=c++11 or -std=gnu++11
enum class side { LEFT, RIGHT, NONE };
Timber.cpp: In function ‘int main()’:
Timber.cpp:169:20: error: ‘side’ is not a class or namespace
side playerSide = side::LEFT;
Timber.cpp:264:26: error: ‘side’ is not a class or namespace
branchPositions[i] = side::NONE;
Timber.cpp:287:18: error: ‘side’ is not a class or namespace
playerSide = side::RIGHT;
Timber.cpp:321:18: error: ‘side’ is not a class or namespace
playerSide = side::LEFT;
Timber.cpp:534:31: error: ‘side’ is not a class or namespace
if (branchPositions[i] == side::LEFT)
Timber.cpp:542:36: error: ‘side’ is not a class or namespace
else if (branchPositions[i] == side::RIGHT)
Timber.cpp: In function ‘void updateBranches(int)’:
Timber.cpp:688:24: error: ‘side’ is not a class or namespace
branchPositions[0] = side::LEFT;
Timber.cpp:692:24: error: ‘side’ is not a class or namespace
branchPositions[0] = side::RIGHT;
Timber.cpp:696:24: error: ‘side’ is not a class or namespace
branchPositions[0] = side::NONE;
Compilation failed.

Per the instructor, I typed out the branches (literally, tree branches) and I get this odd error about the enum class side not being a class or namespace. The key was this portion:

warning: scoped enums only available with -std=c++11 or -std=gnu++11

A Google search and a bit of perusing lead me to change my build script to this:


# You need libsfml installed on your system!

g++ -c -std=c++11 Timber.cpp
g++ Timber.o -o timber-app -lsfml-graphics -lsfml-window -lsfml-system


echo “type ./timber-app to launch”

In order to get it to compile, I had to declare the -std=c++11 during the build. I added it to my Geany program as well, under the settings.


Now it compiles without issue! So far, I’ve only added some bushy branches to my game, but it is coming along nicely! You can check it out at my GitLab if you’d like.

Linux – keep it simple.


Update to Rom/Kernel/TWRP building guide!

Hey everyone!

Just wanted to let you know that I was able to finish and upload another hour worth of videos! That’s right, currently there is more than 9 hours of video tutorial available. As promised, this was added to the series:

* Installing/using VirtualBox
* Fixing a VB Ubuntu problem with screen resolution
* Syncing minimal LineageOS or Omni for building TWRP
* Converting an Omni TWRP device to LineageOS/CM and building it.
* Custom TWRP mods with fonts/icons/splash screens/etc….


Hope that you are enjoying the series, but mostly, I hope that it is informative and gets you building!
I did try to up the video quality, but I had to tone it back down a bit, as the files became a bit large for uploading and handling. The quality is a little better than the first videos, but not exactly 1080p! 

Thanks again for all of the thanks button slaps and YouTube subscriptions. That lets me know that you guys really appreciate the videos. Be sure to check out my Video Tutorial section in the menu for links to the videos!

Linux – keep it simple.

Can you say that again, Mr. Alarm?

While using my Hourglass app for Android phones, a user made an interesting observation:

I love this open source app and using it quite often. But sometimes my phone is in my pocket and I’m listening to music and I miss the time ended notification ! The vibration is short, easy to miss, same thing for the notifications sounds. I’d find “logical” to have a continuous notification that vibrates and rings until I manually stop it (from notification bar or inside app).
Is this feature planned for a future release ?

What a great idea! I’m glad that “bruneton” opened this issue on my issue tracker. That’s part of the beauty of open source. Sure, closed source programs could take input as well, but the open source community encourages and enables it, as well as giving others the code so that they can make changes themselves!

So, I added another button:


And with that button, some new code, which you can check out in full from the commit on my GitLab, but here is the gist of it:

– // Cancel the notification.
 – mNotificationManager.cancel(0);

 – // Set the time bar back to usable.
 – timeBar.setEnabled(true);
 + if (alreYes) {
 + startCount(2000,1000);
 + } else {
 + // Cancel the notification.
 + mNotificationManager.cancel(0);
 + // Set the time bar back to usable.
 + timeBar.setEnabled(true);
 + }

What we have here, is a repeating timer that, if the continuous alarm is set, will “repeat” by resetting the countdown to 2 seconds, over and over again, until you cancel the repeating alarm!

It seems to work well so far, but I think I can do better. So, I’m looking at adding a “Stop” or “Cancel” option to the notification pop up. We’ll see, but for now, it does repeat rather nicely!

Linux – keep it simple.

Putting Android Nougat on a Nook HD+

While there are several guides out there on how to do this, I ran into a slight snag while trying to put Android Nougat on a Nook HD+, so I thought I’d share that with you. I was following this guide: https://nookhdplusandroid7.wordpress.com/

Following through the instructions seemed to go very smoothly, until it didn’t work. Specifically, after putting in the micro SD card, and powering off the device, powering it on would just cause a blank screen. Then, several minutes later, the device would turn on as normal.

Turns out that the Nook just didn’t like my SD card. It was a 4 GB card that I had laying around. When I opened a new package of 16 GB PNY SD cards, the whole process started working.

I don’t want to rehash the excellent write up that was already given, but I thought I would share my small issue, in case someone else runs into that problem. Turns out, there are some newer roms available for the Nook HD+ as well.

Either way, here are a couple of screen shots about showing the outcome:

It seems to work rather nicely. I did notice one slight “glitch” to the screen when I selected MTP for the USB mode, but other than that, it seems to work great! Now I just have to force myself to give it back to it’s owner!

Linux – keep it simple.

C++ and variable screen sizes?


I’m at the end of section 3 of my online course, and I’ve learned so much! I’ll be honest, since Java and C++ are both object oriented languages, I feel that it has been a pretty smooth transition so far.

While not part of the course, I noticed when showing some friends my game, it didn’t look right on their screen. The problem was that the game is coded for a single screen size, and if they have a smaller screen, it doesn’t display properly. Some things are off the screen, or off center.

So, I remembered an old Android trick for similar issues, and started implementing it here. Rather than setting static sizes throughout the game, I set my code up like so:

int sWidth = 1024;

int sHeight = 786;

sf::RenderWindow window(sf::VideoMode(sWidth, sHeight), “Timber!”);

By making the objects variants of sWidth and sHeight, I can later poll the screen size and set the graphics to match. At least that is the plan. Right now I am just doing it manually, but rather than adjusting every line of code, I am just changing the sWidth/sHeigth lines.

You can check out the full commit, including adding text and time bars at my GitLab.

Linux  – keep it simple.

BlueFruit Project: All boxed in!

Spent a little bit of time with a soldering iron.


I put my project into a box, wired in all of the relays, and ran several feet of wire for connecting to the various functions. Hopefully this will work! I’m planning to do some heavy bench testing really soon.


This was my original  schematic. For the most part, I stuck with it, but I did make a few changes along the way. For one, I replaced the second analog input to be a digital input, just routing the brake lights to activate a relay which allows 3.3vdc to go to the input switch.

Another change was adding a parking lights relay, which is activated from the “key on” relay. I don’t have it hooked up in my box yet, but it is in place, just needs the power wire hooked to it. It wasn’t part of the original plan, so I am not implementing it yet. I don’t want to get too crazy before actually testing if it works.

It is going to be really fun to hook this up. I’ll have to crawl around under the dash of my truck and get these wires put in.

Linux – keep it simple.

Video Tutorial on How to Compile Android and Modify Kernels


For those interested, I have just posted a video tutorial series on XDA for building Android Oreo, Nougat, Marshmallow, and Lollipop on 5 different phones, the emulator, and 5 different ROMs. Also included are custom kernel editing, adding apps, changing source code, backgrounds, and more. Here’s what I posted:

From XDA: https://forum.xda-developers.com/android/general/guide-how-to-build-custom-roms-kernel-t3814251


Praise God! Finally a video tutorial of how to build Android and modify kernels!

I have created a video tutorial and guide for how to compile Android, from Lollipop through Marshmallow, Nougat, and Oreo. The video series covers several different phones, the emulator, kernel and rom editing, app source code editing, and much more!

Who is this video series for?
Well, this video tutorial is a step by step guide built primarily for the beginner. This is written for those who already know how to flash TWRP, CWM, or the like, and who have installed a custom rom before. This is designed to help those who are ready to move up from flashing and installing other peoples custom rom to actually start making their own custom roms. I recommend that a beginner watch the entire series in numerical/alphabetical order (the videos are marked).

That said, I believe that an intermediate developer may find a useful trick here and there, and they should just skip ahead to videos of interest. Perhaps kernel development, or something along those lines.

An advanced rom/kernel developer will probably far exceed my feeble abilities, and will not likely find much useful information here. Perhaps if you are an advanced developer, you would consider continuing the tutorial or making an advanced video series! (See further posts for recommendations on contributing videos.)

Why did you put this together?
Well, after building roms for several different devices, I started receiving requests from users who wanted to start building their own roms, but didn’t know how. I didn’t have enough time to answer everyones questions, so I wrote a few guides, pointed others to guides that were available, but there are some things that you just need to see to understand. Hence, the video tutorial. I just hope that someone finds it useful.

This course was written in order! While Lollipop and Marshmallow are old by today’s standards, there is still good learning value in building them, and there are topics covered there that really make them worth watching.

What’s in the videos?
During the series, we will be building for the emulator, as well as 5 different phones of various brands, and 5 different roms. I hope that this will give the viewer a good idea of how to build for their own specific phone as they see the differences and similarities across the phones and custom roms.

+ Ubuntu installation
+ Java installations
+ Using Git, GitHub, GitKraken, and the command line
+ Fastboot and ADB
+ Heimdall/Odin
+ QFIL, QPST, SALT, and other tools
+ AOSP, SlimRoms, PACrom, AOKP, AOSCP
+ Lollipop, Marshmallow, Nougat, Oreo
+ Errors
+ Overclocking CPU/GPU
+ Adding Governors and I/O Schedulers
+ Sound modifications
+ Changing app colors, text, and icons
+ Adding prebuilt apps
+ Adding source code
+ Converting device from one rom to another

**** This is an UNOFFICIAL TUTORIAL. Use at your own risk! ****
Download links:
Ogg Vorbis Video GitLab:
Clicking on a video in GitLab will allow you to watch it online.

Ogg Vorbis Video Downloads:
This download is rather large due to the multiple videos.

MP4 Video GitLab:
Clicking on a video in GitLab will allow you to watch it online.

MP4 Video Downloads:
This download is rather large due to the multiple videos.

I also have several written guides available on XDA, here are a few:

Building ROMs for the Galaxy Note Edge: [url]https://forum.xda-developers.com/note-edge/general/guide-build-aosp-roms-kernels-note-edge-t3488840[/url]
Building ROMs for the Galaxy S4: [url]https://forum.xda-developers.com/galaxy-s4-tmobile/general/guide-step-step-instructions-building-t3402637[/url]


Be sure to check out the videos or the XDA thread! I hope that these will help some of the aspiring Android developers out there!

Linux – keep it simple.

Randomness in C++

One of the most interesting things I’ve learned since completing the second section of my Udemy course on C++ game creation, is that of random number generation. In Android, this process was a little more straight forward, with everything behind the scene just being handled for you. You simply created a “random number generator” class and asked it for a random number within a range.

In C++, at least the way my instructor is teaching us, it is a bit different. It appears that you first need to “seed” the random number generator with some numbers. Here is what I learned:

// Seed our random number with time from system.

srand((int)time(0) * 10);

// Use the random to get a number between 0 and 199.

beeSpeed = ((rand() % 200) + 200);

// Now set the bee’s starting position.

srand((int)time(0) * 10);

float height = ((rand() % 700) + 100);

It is a little snippet from the commit with all the code to move bees and clouds on the screen.

So, if I understand correctly, you have to first seed the random number. From the instructor, an easy to grab item to seed it with that changes often is the time. So, we are seeding the random number generator with the time multiplied by a number of our choosing.

If you just used an static number, then I believe the returned random number will always be the same. By using the time, which continues to change, then you will grantee that you don’t get the same input seed, making a similar random return highly improbable.


Right now, the background includes a few moving clouds and a bee. Not much to see, but you are welcome to check it out at my GitLab.

Linux – keep it simple.

Finding apps for a ZTE Z432 dumb phone!

My wife and I recently picked up a dumb phone for things like hunting/camping/fishing. You can get them pretty cheap, and the battery life is fantastic compared to most smart phones. Besides, if you loose it, you’re only out a few bucks.

While a dumb phone is, well, dumb, we were hoping to spruce it up with a few apps for some entertainment value. Especially if you use it while traveling, like taking a plane or boat to some remote spot.

After some web searching, all I could come up with was that AT&T, who sells the ZTE Z432 phone, said that this phone did not support any apps. I recalled the yester-years spent using apps on dumb phones, and I knew this just couldn’t be true. So, if this is your plight, and you also failed to find the answer through a web search, then here you go:


I want to be clear that I am in no way endorsing “Dertz”, and I can’t say that all of their apps are safe. In fact, this may be a sure fire way to nuke your dumb phone. However, I did download and install this one:


and it worked great! How can you go wrong with Scrabble Remix?

The easiest way to install them, is to open the link in the phone browser. Once there, scroll down to the download button, and click it. A pop up will ask you if you really want to download that jar file, and if you say yes, a progress bar will appear. Once downloaded, it will be in your folders.

Find the app you downloaded in your folders, and click on it. It will pop up an install question, and if you say yes, it will ask where to install the app, in either Applications, or Games. In my case, I chose Games. After a minute or so, the app was installed and a pop up asked me if I wanted to open it. Scrabble Remix – game on!

I also experimented with the Bluetooth, which works well. Just download the app you want on a smartphone, or in my case, a Bluetooth capable computer, pair with your Z432, and send the file over that way, if you want to save yourself from painful dumb phone browser experience, or save bandwidth.

For the record, we can just insert our normal sim card from our smart phone into the dumb phone, and it works, however, we did need a sim card holder, because our smart phones use micro sims, and the dumb phone used standard sim cards, but they make a little micro to standard holder that your sim card can pop in and out of. If you need one, stop by just about any cell phone dealer, they should have one.

Linux – keep it simple.

Adding a countdown timer to my Android notification….

This was actually a great idea brought up by a user, and posted in my issue tracker for the Hourglass app. He pointed out that it would be really handy to have the remaining time posted in the notification popup, and get it to be consistently updated.

I thought there must surely be something for this in Android already, but I couldn’t find one. However, I did find a chronometer that can count how long a notification has been open. With some careful thought, here is what I came up with:

NotificationCompat.Builder builder = new NotificationCompat.Builder(context)

What I found was that I could “back up” time to before the notification started. Essentially giving it a negative number. Then, passing the time saved for recurring alarms (even saved if not used), then I can set it to a negative of that number. Now it counts “up” from negative time, giving the appearance of counting down your timer!


Works pretty well, however, 2 interesting things. I would have thought the code should be MINUS recureTime, not PLUS recureTime, but it only works properly with PLUS.

Second, the “countdown timer” in the notification doesn’t track exactly with the Hourglass app timer. In the course of several minutes, it becomes off by a second. Odd, but workable. The timer still goes off in the app on time, just that the countdown in the notification may get there a second early.

Linux – keep it simple.