Re: C question.
Re: C question.
- Subject: Re: C question.
- From: Josh Morris <email@hidden>
- Date: Sat, 15 Jun 2002 12:30:04 -0500
I changed the files' names to end with ".mm" and, regrettably, nothing
changed. The weird thing is, although the header file is C++, all of the
code is C. There are no class definitions.
Is there any reason why "inline" or "extern" would cause problems with
duplicate function names? If I remove "inline" and/or "extern" would
that fix the problems?
I still think there should be some way to get these errors to stop
happening. Is there a build preference I could change that would allow
functions with same names (yet different arguments) to co-exist?
Bah. I feel like such a newbie.
Thanks for any help.
-Josh Morris
email@hidden
On 土曜日, 6 15, 2002, at 12:09 PM, Andrew Pinski wrote:
>
I must be a c++ header.
>
>
If you want to use these in functions in an objective-C code use the
>
file ending of .mm for the Objective-C++.
>
>
Thanks,
>
Andrew Pinski
>
>
On Saturday, June 15, 2002, at 12:47 , Josh Morris wrote:
>
>
> I am trying to make plib (plib.sourceforge.net) work aside my Cocoa
>
> program so I can use its math routines.
>
>
>
> Unfortunately, ProjectBuilder refuses to compile the header file
>
> because
>
> it has multiple declarations of the same function. These functions have
>
> different arguments, however.
>
>
>
> Here's a snippet:
>
>
>
> //Function #1
>
> extern void sgMakeCoordMat4 ( sgMat4 dst, const SGfloat x, const
>
> SGfloat
>
> y, const SGfloat z,
>
> const SGfloat h, const
>
> SGfloat
>
> p, const SGfloat r ) ;
>
>
>
> //Function #2
>
> inline void sgMakeCoordMat4( sgMat4 dst, const sgVec3 xyz, const sgVec3
>
> hpr )
>
> {
>
> sgMakeCoordMat4 ( dst, xyz[0], xyz[1], xyz[2],
>
> hpr[0], hpr[1], hpr[2] ) ;
>
> }
>
>
>
> Here are some of the errors:
>
> /Users/jmorris/Documents/L3D/SG Library for OS X/sg.h:135: conflicting
>
> types for `sgMakeCoordMat4'
>
> /Users/jmorris/Documents/L3D/SG Library for OS X/sg.h:132: previous
>
> declaration of `sgMakeCoordMat4'
>
> /Users/jmorris/Documents/L3D/SG Library for OS X/sg.h: In function
>
> `sgMakeCoordMat4':
>
> /Users/jmorris/Documents/L3D/SG Library for OS X/sg.h:137: incompatible
>
> type for argument 2 of `sgMakeCoordMat4'
>
> /Users/jmorris/Documents/L3D/SG Library for OS X/sg.h:137: incompatible
>
> type for argument 3 of `sgMakeCoordMat4'
>
>
>
> I would guess that this has something to do with the namespace not
>
> wanting to allow two same names. I thought that you were supposed to be
>
> able to do this in C, provided there were different arguments. Is
>
> this a
>
> build setting or something? I thought you could use Obj-C and C in the
>
> same project. :/
>
>
>
> Thanks for any help.
>
>
>
> -Josh Morris
>
> email@hidden
>
> _______________________________________________
>
> 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.
_______________________________________________
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.