[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: converting C to C++ : linkng problems

On 12/13/05, Joris Huizer <jorishuizer@planet.nl> wrote:
> Thanks for some background -- but this really is not the issue in my
> case, as I changed the Makefile to compile everything with g++ - that
> is, there are no C-bits mixed with C++ bits - it's still a mystery to me
> how C++-mangled function names end up not being found by the same C++
> compiler but...
> I'll check for C prototypes without any parameters and the information
> on bison+C++ ...
> Though it might be the case that output of `flex --c++  spascal.l`
> causes problems :-/

For the symbols that aren't being found, are you sure these are
defined in C++, or could they be external C functions that need an
extern "C" in front of their declarations?  You might also want to use
c++filt on the mangled names of both the missing symbols and the
apparently-corresponding symbols in the .o or .a files.  You can also
give nm the "-C" flag to automatically demangle names.  Comparing
mangled names can also be useful, since those have to match exactly. 
nm is your friend here.

Michael A. Marsh

Reply to: