This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: REF: c & C++


> From: Derek Coleman <Derek.Coleman@meluksoft.co.uk>
> To: "'gcc-bugs@gcc.gnu.org'" <gcc-bugs@gcc.gnu.org>
> Date: Mon, 24 Jul 2000 10:04:17 +0100

> From: Derek E Coleman M.Eng (Elec & Comp Sci), I.Eng MIIE(elec).

This is redundant with the line above, you can remove it.

> Email  <mailto:Derek.Coleman@meluksoft.co.uk>

This is redundant with the line above, you can remove it.

> Date: Monday 24th July 2000

This is redundant with the line above, you can remove it.

> I wonder if someone can help me.

I can only try.

> My source code project is large.  It consists of old C source files,
> written by others and new C++ source I wish to link with old C in
> other files.

> My problem follows:
> 	I have to compile C with -x c and C++ with -x c++.

Or you can use file suffixes like .cpp or .C for C++ code and .c for C
code.  Or you can use gcc to compile C files, and g++ to compile C++
files...  Lots of possibilities.  I'd not recommend what your doing.

> Otherwise the old code throws up errors. If I try and compile the
> old code via c++ the, strict type checking stops the compilation.
> Using -x c allows me to compile sucessfully.

> If it is calling static member functions I cant re-write all the old
> source code, theres loads of it.

> Any ideas?

You can have a forwarding extern "C" function that forwards to the
static member functions.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]