Okay so I'm rebuilding an old counting program of mine because I want to assemble a private header file(Some function I just want to be able to call whenever instead of having to keep them in some random file somewhere on my drive to copy paste whenever I need them. I'm trying at this moment to get std::cout to work so here be the code.
Code:
#include <iostream> //I think I need this for this program
#define infinite while( 1 < 2 )
int count = 0;
int main() {
infinite{
std::cout << count;
count++;
}
}
error is
Code:
/tmp/cc9iYJpZ.o: In function `main':
counter.cpp:(.text+0xd): undefined reference to `std::cout'
counter.cpp:(.text+0x12): undefined reference to `std::ostream::operator<<(int)'
/tmp/cc9iYJpZ.o: In function `__static_initialization_and_destruction_0(int, int)':
counter.cpp:(.text+0x4a): undefined reference to `std::ios_base::Init::Init()'
counter.cpp:(.text+0x59): undefined reference to `std::ios_base::Init::~Init()'
collect2: error: ld returned 1 exit status
What's the problem here? did I forget something somewhere it's been awhile since I've done cpp coding. At all.
--Djyou