jeudi 28 septembre 2017

cpp file not compiling in clang++ and g++

I have been working on C++ for few years now and have compiled stuff several times but the following issue is totally new to me and it just doesn't make sense.

Following are the steps i am following:

  • using cygwin setup with g++ version:6.4.0 and clang++ version:4.0.1
  • created a new cpp fie using sublime text added simple cout and compiled
    with the command: clang++ -g -Wall -std=c++14 thread1.cpp -o thread, works fine.
  • added new contents maybe another cout, this time upon compilation i get a ton of errors stating its not utf-8 file.
  • saved the file using utf-8 encoding in sublime text and also tried with utf-8 BOM encoding, still getting same not utf-8 file error.
  • ran the file command in cygwin to check file encoding , file -i thread1.cpp, got output as thread1.cpp: text/x-c; charset=utf-8.

Any pointers to what might be going wrong here?

Aucun commentaire:

Enregistrer un commentaire