Re: C question.
Re: C question.
- Subject: Re: C question.
- From: Andrew Pinski <email@hidden>
- Date: Sat, 15 Jun 2002 13:09:38 -0400
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.
References: | |
| >C question. (From: Josh Morris <email@hidden>) |