QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Fifi on October 01, 2018, 02:22:47 pm
-
Hello all,
Just a simple (may be a dumb) question:
With Linux (as well as OS/X and Windows) QB64 translates the .bas source file in c++ (I guess a .cpp file), then compiles that c++ file to create the executable.
However, where is located this c++ file (just to see the translation) ?
TIA.
Cheers.
Fifi
-
Try qb64\internal\temp\main.txt
-
Main.txt also includes several other files.
You must notice that main.txt itself is included in internal/c/qbx.cpp, which is the main file compiled by gcc.
-
Hi Fellippe,
Thanx for your post.
Main.txt also includes several other files.
You must notice that main.txt itself is included in internal/c/qbx.cpp, which is the main file compiled by gcc.
Would it be possible for QB64 to create a "internal/c/myprog.cpp" the Vs the basic "internal/c/qbx.ccp" file when compiling the "myprog.bas" file, then to compile that "myprog.ccp" file?
a) This would allow QB64 to create separated .cpp files when it's started simultaneously from mutiple sessions (e.g. by a script launching several instances of QB64 to compile different source files without waiting the result of one or other compilation process to continue with the other source files),
b) This would be more relevant with the multi process systems we all are using today.
What do you think?
TIA for your response.
Cheers.
Fifi
-
Multiple sessions of QB64 already generate multiple qbx.cpp files. You'll find qbx.cpp, qbx2.cpp, qbx3.cpp, etc.
-
Hi again Fellippe,
Multiple sessions of QB64 already generate multiple qbx.cpp files. You'll find qbx.cpp, qbx2.cpp, qbx3.cpp, etc.
So, why not changing the name of the generated .cpp file accordingly to the .bas source file (e.g. myprog.bas would generate myprog.cpp when test.bas would generate test.cpp) in order to avoid confusion?
For me, that should not be a big change to do and really makes sens.
What do you think?
TIA.
Fifi
-
For me, that should not be a big change to do and really makes sens.
What do you think?
Hi. I don't think it's a necessary change.
All the C++ work done in the background should remain away from the end user's eyes. What should matter is that your .bas code became an executable, not the process in-between.
If an advanced user wants to dig into the generated C++ output, then he/she should be able to grasp the current structure with no issue.
-
Hi Fellippe again,
I didn't say it's a necessary change, but only that would make sens especially if a progam such as a web server launch multiple sessions of QB64 at the same time, some of the .bas source files being very small or very large. Then, how to check a problem with prog1.bas or prog2.bas or ... progn.bas when you don't know what .cpp file was created when they all are named qbx?.cpp!
Not a complain, just a thought.
Cheers.
Fifi
-
The qbx.cpp file and its variants never change contents. User code is translated into main.txt located in internal/temp (or internal/temp2, internal/temp3, according to the instance open). A user will know in which folder to look at when a C++ compilation error occurs because that information will be disclosed in the compilation log which is generated. The IDE shows a link to this log file and command line compilation shows the log file location when an error occurs.