0
I am creating a programming language in C++, and I intend to make some system to work with multiple files.
In the simple build process, the interpreter creates files .cpp
and .h
and then compiles all together into one executable, and then erases the files. I intend to add a system that will Compile the files to .o
, and then deletes the files .cpp
and .h
. The problem is that the #include
C++ only copies the contents of .h
, so, if I modify a file and compile it in .o
, I will also have to compile all those who depend on it. Also, with this system I can not import also a single function or class, as is done in Python using from ... import
for example.
My question is, is that what I said absolutely right, and if so, is it possible to circumvent it? Remembering that I don’t want the programmer to see the files .cpp
and .h
, unless requested otherwise.
Do you then compile to C++ and then generate the object file? I answered something about how the compilation of a C/C++ file works, with notes on inclusion and such. I’ll send you, can help you
– Jefferson Quesado
Might interest you: how the issue of
#include<arquivo.h>
: https://answall.com/a/213804/64969– Jefferson Quesado