Why does the name of a source file affect compilation?

前端 未结 4 1057
逝去的感伤
逝去的感伤 2020-12-11 02:04

I came across something really weird when I wrote a little lotto program in C++ called \"lotto.cpp\". Everything was fine until I wrote the write-to-file for my program. Whe

4条回答
  •  心在旅途
    2020-12-11 02:32

    FWIW I got this error when I was trying to write my output file into a directory that hadn't been created yet, i.e. bin/myprogram.

    Once I created the bin directory everything was fine; I didn't have to re-name anything. GCC seems to create the directory if it doesn't exist, whereas clang doesn't (at least thats as near as I can tell).

提交回复
热议问题