Page 1 of 1

C++ code compilation supportion

Posted: Fri Feb 08, 2008 12:42 pm
by Yourself
OK.
I suggest that the Pure team should add the gcc C++ Compiler so that c== can be supported in our apps.
The C code could be compiled to an object file by GCC and the Linker would put together the C++ code object and the objects created for our programs resulting in the program being able to use c routines

Posted: Fri Feb 08, 2008 3:54 pm
by Trond
You can use object files already, so why not compile the C files manually (or with a an IDE tool that runs when you compile)?

Posted: Fri Feb 08, 2008 4:33 pm
by Psychophanta
The idea is not bad, imo.

Even C/C++ is a very bad language for me, having the posibility would not be bad.

Posted: Fri Feb 08, 2008 4:52 pm
by inc.
This can be done using a precompiler.

- mark a codepart as a "C" or "C++" part using EnableCPP and DisableCPP like known from EnableASM and DisableASM.
The parser copies that part to a blank.cpp file and sends it to GCC,
finally the rest will be compield by PB itself and finally a polink comment should give the needed argument for linking with the pre compiled object.

But ... like Trond suggested, compiled lib's and obj's can be simply 'Import'ed by PB natively ... and I always would use a C++ IDE for developing C++ code parts (not mention indentation, highlightning, etc etc etc).