Skip to content

[Error Log] P2.4_1 No such file or directory *

Juhwi Eden Kim edited this page Oct 19, 2019 · 2 revisions
cerr << "Error: " << strerror(errno) << endl;
// filePath == "vertShader.glsl"
string readShaderSource(const char *filePath) {
    string content = "";
    ifstream fileStream(filePath, ios::in);
    cerr << "Error: " << strerror(errno) << endl;  // No such file or directory
    cout << fileStream.is_open() << endl;  // 0
    string line = "";
    while (!fileStream.eof()) {
        getline(fileStream, line);
        content.append(line + "\n");
    }
    fileStream.close();
    return content;
}

strerror(errno)가 'No such file or directory' 에러 메세지를 출력, 파일 스트림의 is_open()은 false. while문이 무한루프에 빠짐


xcode에서 상대적 directory 주소가 적용이 안됨 일단 절대주소로 대입하니 작동 Working Directories and Build Locations -> 나중에 봐야지

Clone this wiki locally