Re: C with C++ in xcode
Re: C with C++ in xcode
- Subject: Re: C with C++ in xcode
- From: Markian Hlynka <email@hidden>
- Date: Wed, 28 Sep 2005 13:39:20 -0600
What error are you getting?
Do you realize that if your header is called foo.h, you should be
including <foo.h> or "foo.h", NOT any variant of <cfoo> or <cfoo.h>
or same using ".
Markian
On Sep 27, 2005, at 20:46, Joe Kurtz wrote:
Thanks for the replies.
I've tried both Eric's and Markian's suggestion. Nope.
I get the same error reported by the linker (undefined
symbols).
Maybe there's something else amiss here.
I note that the c functions I want to use are
returning float** types.
(could this have implications?)
--- "E. Wing" <email@hidden> wrote:
From: Markian Hlynka
I just wanted to add that if for some reason you
really can't modify
the C header files, you could probably do what
eric describes
slightly differently. In your c++ .h file:
#ifdef __cplusplus
extern "C"{
#include "mycfile.h"
}
#endif
This is icky, but at least if you do it this way,
and cplusplus is at
some point not defined, you'll get all sorts of
errors because your c
header(s) won't be included either. This is also
ugly because you'd
have to do it every time you wanted to include
mycfile.h. But, if
it's only once, it might be worth it <shrug>.
Another trick you can do if you can't (or don't want
to) modify
'mycfile.h', but don't want to remember to put the
__cplusplus guard
around every include instance, is to encapsulate the
above code into
another header file, such as 'mycfile.hpp'. Then
#include
"mycfile.hpp" instead of mycfile.h file in your C++
code.
_______________________________________________
Do not post admin requests to the list. They will be
ignored.
Xcode-users mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
40yahoo.com
This email sent to email@hidden
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40cs.ualberta.ca
This email sent to email@hidden
----
When arguing with an idiot, be sure they aren't doing the same.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden