Improve interaction between files

Asked

Viewed 43 times

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

  • Might interest you: how the issue of #include<arquivo.h>: https://answall.com/a/213804/64969

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.