Topic: compiling C++ and C programs


Author: amonge@cs.ucsd.edu (Alvaro Monge)
Date: 16 Jul 92 07:19:09 GMT
Raw View
Hello, I am currently working on a big system whose source
code was written in C (compiled with cc, so I assume this is
old style C especially since there are no function prototypes).

Well Now, we would like to add new modules to the system and
would like to take advantage of a library of C++ functions which.

Now my questions are:

Can I link the old system object files (compiled with cc -c)
   with the library and new modules written in C++?
   NOTE: the main program is in the old system and was changed
   somewhat in order to incorporate the new modules.

I've tried compiling this, but I assume that the object files
created by C++ are not the same kind of object files created
by the C compiler cc and that this is the reason for the
linking to fail.

Can I do this by making minimal changes to the system?  Again
this system is very big an complex and I would like to make as
little changes as possible.



Along the same lines:
When I try including header files from this system into my
C++ modules, I get the following warning:

"include_hdr.h", line 28: warning: ``/*'' in comment

Now I know that when I use this header file with the c compiler
I get no such warnings.  What is going on?  In the system
there are include files which include other files, etc.  (i.e.
nested inclusion of header files).  Would this have anything
to do with it?


Thanks for the help.
amonge@cs.ucsd.edu