QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: Ryster on March 12, 2019, 10:31:22 am
-
Is the code translated into C language in: internal / temp / main?.
Regards
-
Yes.
-
Master, thank You very much.
Regards
-
Here's one I've been just curious about. Let's say I compile my program, go to that folder, get the main.txt file. Now if I were to open that up in a C studio, like Bloodshed, would it compile outside the QB64 environment?
Pete
-
Not without some effort. Also check makeline.txt
-
Glad I asked. I thought at some point I might want to revisit learning C/C++ and it would be neat to make a working program in QB64 and use the translated C code. It's kind of a shame, I guess probably because of work time, that Rob couldn't make it spit out a fully finished C/C++ program. Anyway, my instincts tell me it would take longer to try to figure out how to piece those parts together, without already knowing a lot of C/C++ than it would be to just learn C/C++ from the ground up. It isn't anything I am considering for now. As I said, just curious, but many thanks for clearing it up.
Pete
-
The place to start would be in the internal/c folder. You’ll see a file there called (I don’t remember).cpp. (It’s 3 letters; something like qbc.cpp and multiple copies will be qbc2.cpp or qbc3.cpp...). It’s what’s actually compiled with main.txt and the other files in the internal/temp folder included in it.
If you want to learn from the top/down, and not just look at the translated function calls and all, it’s the file you’d want to study first. ;)
EDIT: File is qbx.cpp or qbx2.cpp, depending on how many instances of the IDE you have open at the time.
-
Thanks. I remember that extension form C/C++ files I created in Bloodshed many moons ago. I have to say though, when I read through the code I get real turned off, fast. It probably has something to do with my absolute hatred of foreign languages. To me, BASIC is almost completely English, C is Greek... and FB is Polish. Hmm, now I miss my old Polish friend from high school. We'd go at each other with the Polish jokes vs Italian jokes all the time... before all this PC crap existed. Ah, the good ol' days.
Pete
-
Everybody who wanna learn C/C++, this site is a great resource to do so:
http://www.cplusplus.com/doc/tutorial/
-
Thanks for sharing that. I suppose if I were to dabble again, I'd get Eclipse or I guess Code:Blocks is still hanging in there. It bugs me that most people say get Visual Studios. I had it back in 2000, and I couldn't stand that piece of crap.
Pete
-
It is not without reason that I asked where C is. Well, as part of the distribution of QB64, I sent a 64-bit version to a friend. The colleague claims that he does not create the main.txt file. Maybe someone knows what is causing this. Greetings
-
You mean you sent him QB64, or a program written with QB64. I'm pretty sure you mean QB64, but just asking. I also don't know if all programs get a main.txt file created.
Pete
-
And so: on my computer the file main.txt is created. However, there is no such file at a friend of this file. Of course it's about the 64-bit QB64. I have Win10 and my friend Win7. I think this is not the cause.
-
It may be write permissions. Make certain he installed his version to its own directory (like C:\QB64) rather than in C:\Windows or C:\Program Files...
Second tip: Make certain his antivirus isn’t quarantineing or deleting the file as fast as QB64 makes it.