diff --git a/Makefile.win b/Makefile.win index 989dcc4..cc803ff 100644 --- a/Makefile.win +++ b/Makefile.win @@ -2,7 +2,7 @@ CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ RM=rm -f CPPFLAGS=-Wall -LDFLAGS= +LDFLAGS=-static LDLIBS=-lm SRCS=main.cpp Spigot.cpp diff --git a/Spigot.cpp b/Spigot.cpp index 9e44b72..79228ed 100644 --- a/Spigot.cpp +++ b/Spigot.cpp @@ -39,7 +39,7 @@ void Spigot::pump(void) { // output all predigits long unsigned pdLen = this->preDigits.size(); for(long unsigned int j = 0; j < pdLen; j++) { - std::cout << this->preDigits.back() << std::flush; + std::cout << this->preDigits.back(); this->preDigits.pop_back(); } this->preDigits.insert(this->preDigits.begin(), tempPreDigit); @@ -50,7 +50,7 @@ void Spigot::pump(void) { tempPreDigit = 0; long unsigned pdLen = this->preDigits.size(); for(long unsigned int j = 0; j < pdLen; j++) { - std::cout << (this->preDigits.back() + 1) % 10 << std::flush; + std::cout << (this->preDigits.back() + 1) % 10; this->preDigits.pop_back(); } this->preDigits.insert(this->preDigits.begin(), tempPreDigit); @@ -60,5 +60,6 @@ void Spigot::pump(void) { } catch (int e) { std::cout << "An exception " << e << " occurred." << std::endl; } + std::cout << std::flush; return; }