It probably couldn't find the file, so opening failed. Make sure the file is in the current directory (if launching from an IDE, this is often the project directory and not necessarily the same directory the exe is in).
Note that after you get the file to open, that input loop will run past the end of file and produce one extra line of output and one extra item in the vector "lines" (specifically, an empty string), because it does not check the status of the stream after reading from it.