In tokenizer.hpp: #ifndef TOKENIZER_HPP #define TOKENIZER_HPP #include #include #include namespace tokenizer { typedef std::string token; typedef std::vector tokens; tokens tokenize(std::istream&); ... } #endif In tokenizer.cpp: #include #include #include #include #include "util.hpp" #include "tokenizer.hpp" tokens tokenizer::tokenize(std::istream& is) { tokens toks; std::string line; while (is.getline(line)) { std::string::iterator start, stop, end; end = line.end(); start = stop = line.begin(); ... } }