27-08-2022, 07:12 PM
I will reuse this thread.
When .hpp file is included in a project, it is treated as .cpp file (included in compilation and linking).
If there is "#pragme once" in the beginning, I get "warning: #pragma once in main file" and linker reports:
"file format not recognized; treating as linker script" and finally gives up with "syntax error".
In order to successfully build a C++ project, I have to manual exclude the .hpp files from compilation and linking.
Is this normal?
When .hpp file is included in a project, it is treated as .cpp file (included in compilation and linking).
If there is "#pragme once" in the beginning, I get "warning: #pragma once in main file" and linker reports:
"file format not recognized; treating as linker script" and finally gives up with "syntax error".
In order to successfully build a C++ project, I have to manual exclude the .hpp files from compilation and linking.
Is this normal?