Re: C question.
Re: C question.
- Subject: Re: C question.
- From: Sherm Pendley <email@hidden>
- Date: Sat, 15 Jun 2002 14:24:03 -0400
I checked the plib page on SourceForge - it is, indeed, written in C++,
not C.
On Saturday, June 15, 2002, at 01:30 PM, Josh Morris wrote:
The weird thing is, although the header file is C++, all of the
code is C. There are no class definitions.
The lack of class definitions doesn't necessarily indicate that the
source is C rather than C++.
The C++ definition includes many non-oop additions to the C language,
and many of those additions are not backwards-compatible with C. Some of
the additions, such as single-line comments, have also been added to
newer versions of the C language, but many have not.
In fact, some developers just use C++ as a "better C," without ever
using OOP at all - it sounds as if that's what the plib team is doing.
If I remove "inline" and/or "extern" would
that fix the problems?
Type modifiers are not the problem; if they were, you'd be getting a
different error. Duplicate function names are the problem. C++ allows
them, so long as the arguments are different, but C does not allow them
at all.
I still think there should be some way to get these errors to stop
happening.
Rename the Objective-C file that includes the header you need with a .mm
extension, causing the compiler to treat them as Objective-C++ instead.
Do a "clean" build, to make certain that your new file gets rebuilt, and
then rebuild your project.
Is there a build preference I could change that would allow
functions with same names (yet different arguments) to co-exist?
IIRC, there is a compiler flag that forces it to treat all your code as
Objective-C++, regardless of the file's extension. I would only suggest
using that as a last resort, however, as it would simply mask the
symptom, rather than fixing the cause of the problem.
sherm--
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.