As others have demonstrated, use a hard coded string literal to test your shader code.
Likewise, write a small program to demonstrate and test file loading. For example, you can load a file into a string fairly simply using streambuf iterators:
#include <string>
#include <iterator>
#include <fstream>
#include <iostream>
std::string read(std::istream &stream) {
std::istreambuf_iterator<char> begin(stream);
std::istreambuf_iterator<char> end;
return std::string(begin, end);
}
int main() {
std::ifstream in("ReadMe.txt");
if(in) {
std::string data = read(in);
std::cout << "The file contents are:\n";
std::cout << data;
} else {
std::cerr << "Failed to open the file" << std::endl;
return 1;
}
}
It is also possible to make read() a one liner, but it falls afoul of the most vexing parse.Once you've verified that you can load strings correctly, and that you can create and use shaders correctly, then is the time to create a program that does both. Breaking a complex task into simpler sub-tasks is called "divide and conquer" and is absolutely necessary for writing functioning and maintainable software.