H. R. LEPROFESSEUR  SUBJECTS  SHOP

 SUBJECTS } LINUX } Install gcc on centos and make it work

Sept 6, 2023.

1. Install gcc from repository: sudo yum install gcc-c++

If you try to compile c++ files, some of files where you are useing iostream etc, you may encounter errors like, error: no matching function for call to ‘std::basic_ifstream::open(std::string. You may need to pass extra arguments with g++, e.g.

g++ -c -fno-stack-protector -std=c++11 -g reader.cpp -o reader.o

g++ -c -fno-stack-protector -std=c++11 -g main.cpp -o main.o

Once object files are done, you can now create executable: g++ main.o reader.o -o exe

Please leave a short message for errors, comments or anything else: hr@Leprofesseur.org