Генератор файлов создает строки, заканчивающиеся символом новой строки. Вы должны раздеть это, если вам это не нужно:
with open ("accounts.txt", "r") as usernames:
for username in usernames:
username = username.rstrip()
...
Вы можете связать стандартную библиотеку c ++ с флагом -l
для gcc:
gcc cplusplus.o -lstdc++ -o myexe
If you run g++ with the "-v" option, it will show what command and options it uses. You should be able to deduce the correct gcc command line from there.