How to improve my question?
- Inicie sesión o regístrese para enviar comentarios
How to test from Debian GNU/Linux using g++?
I trying compile an example of a book.
The program use three classes: Book, Customer and Library.
When i compile the example with the following command:
g++ -g -Wall Book.cpp book.h -o book
The result expected is bad:
Book.cpp:1:10: fatal error: Set: No existe el fichero o el directorio
#include
^~~~~
compilation terminated.
This example was tested from another compiler. The library is not recognized.
The book is C++17 By Example, published by Packt.
My question was closed!
Adjunto | Tamaño |
---|---|
Captura de pantalla_2021-07-30_11-27-12.png | 27.45 KB |
Can you attach/link to the source code you try to compile?
Attach the source code here!
Adjunto | Tamaño |
---|---|
source.tar.gz | 1.84 KB |
At first, I imagined that the differences were due to the authors using Microsoft Visual C++ that would be more permissive (I actually have no idea): it would somehow automatically "#include <string>", "#include <list>", #include <fstream> and be "using namespace std;" at the beginning of book.h, add a semicolon at its end, etc. However, there are also typos such as "book" instead of bool" in customer.h, supernumerary quotes at the beginning of the output stream operator for a Book and that operator uses class variables (m_borrowed, m_reservationList and m_customerId) that are not declared.
I would stay away from that content (unless you are responsible for introducing the typos, for mixing different version of files, etc.).
But, how to improve my question?.
![Captura de pantalla_2021-08-05_10-04-33.png Captura de pantalla_2021-08-05_10-04-33.png](https://trisquel.info/files/imagecache/thumbnail/Captura%20de%20pantalla_2021-08-05_10-04-33.png)
You have not linked to the question you asked. Anyway, you should properly describe the steps you followed (without digressions) and precede the commands with "LC_ALL=C " (without the quotes) to have them output messages in English.
- Inicie sesión o regístrese para enviar comentarios