C++ code compilation supportion

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Yourself
User
User
Posts: 17
Joined: Fri Jan 18, 2008 2:47 pm

C++ code compilation supportion

Post 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
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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)?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Post 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.
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post 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).
Check out OOP support for PB here!
Post Reply