Hi,dear friend.
FreeBasic is the more powerful language,could you add converting to ISO C/C++ function,not only -gen gcc?
The C file is more diffcult to read.
Sugesstion in FB
Re: Sugesstion in FB
FreeBasic is open source, so feel free to try adding a C++ emitter
If you try yourself, perhaps you will understand why it hasn't been done yet (what you are asking for is not trivial at all, it would require rewriting almost one third of the compiler)
If you try yourself, perhaps you will understand why it hasn't been done yet (what you are asking for is not trivial at all, it would require rewriting almost one third of the compiler)
Re: Sugesstion in FB
IBMInfo78, if you want a basic to C translator then you may be interested in BCX https://bcxbasiccoders.com/
Re: Sugesstion in FB
QB64 produces C++ code, although it's not very readable
Re: Sugesstion in FB
It's not really possible to generate "readable" C++ code from any compiler from a different language, at least as the original poster would like to see it. You're always going to have to have extra variables kicking around, and FB runtime setup and cleanup routines surrounding common calls. And given these constraints, there's zero reason to emit C++ code as opposed to C code, and a ton or reasons not to do it. If the OP wants readable C++, he needs to write in C++ code. The only reason I can think of to emit C++ code is to more easily inter-operate with C++ libraries, something that is nearly impossible for FB to do at present. But to make FB fully interoperate with C++ is really to make FB a C++ compiler, which is probably a bad idea (and completely unrealistic).