Based on my (simplistic) text on my Linux machine, stream buffering may be doing you favours you don’t want it to.
For example, this outputs “yay” to the console once a second and you can see the text appearing in the build panel while it happens:
#include <stdio.h>
#include <unistd.h>
int main ()
{
while (1)
{
printf ("yay");
fflush (stdout);
sleep (1);
}
}
Commenting out the fflush
stops it from working. Or if you will, based on this test it IS working, but you need to wait for enough output to be generated to fill the stream buffer so that it gets written out (and thus picked up by Sublime). Assuming a buffer of 64k, the loop needs to run 21,845 times to fill the buffer, and at 2 seconds per output you just need to wait 12 hours or so. 
So, something like cout << "yay" << flush;
should make your code work, assuming I’m remembering exactly how that works in C++ (it’s been a while).