FROM : Dave Carrigan
DATE : Fri Feb 08 23:58:47 2008
On Feb 8, 2008, at 2:51 PM, Philip Bridson wrote:
> I am trying to write using Objective-C++. I have read the docs and
> understand what I can and can't do with it but I have a really basic
> problem. When I put #include <iostream> in my header files I get an
> error saying that the file cannot be found? Why is this?
Most likely because the compiler doesn't think that it's compiling an
objective-c++ file, which means that it isn't using the C++ header
search paths. What extension are you using for your filename? You have
to use .mm to tell the compiler that it's objective-c++.
> Also when creating the file, do I create a C++ file or an Obj-C file
> or doesn't it matter?
It should be a .mm file.
> Finally, I want to do some thing like this
>
> #ifdef _MAC_OS_X
> //do some obj-c code
> #endif
>
> #ifdef _WIN32
> //use WIN32 API coding
> #endif
#ifdef __OBJC__
//objc only stuff
#endif
--
Dave Carrigan
<email_removed>
Seattle, WA, USA
DATE : Fri Feb 08 23:58:47 2008
On Feb 8, 2008, at 2:51 PM, Philip Bridson wrote:
> I am trying to write using Objective-C++. I have read the docs and
> understand what I can and can't do with it but I have a really basic
> problem. When I put #include <iostream> in my header files I get an
> error saying that the file cannot be found? Why is this?
Most likely because the compiler doesn't think that it's compiling an
objective-c++ file, which means that it isn't using the C++ header
search paths. What extension are you using for your filename? You have
to use .mm to tell the compiler that it's objective-c++.
> Also when creating the file, do I create a C++ file or an Obj-C file
> or doesn't it matter?
It should be a .mm file.
> Finally, I want to do some thing like this
>
> #ifdef _MAC_OS_X
> //do some obj-c code
> #endif
>
> #ifdef _WIN32
> //use WIN32 API coding
> #endif
#ifdef __OBJC__
//objc only stuff
#endif
--
Dave Carrigan
<email_removed>
Seattle, WA, USA
| Related mails | Author | Date |
|---|---|---|
| Philip Bridson | Feb 8, 23:51 | |
| John Stiles | Feb 8, 23:56 | |
| Dave Carrigan | Feb 8, 23:58 | |
| Philip Bridson | Feb 9, 00:03 | |
| John Stiles | Feb 9, 00:06 | |
| Wesley Smith | Feb 9, 00:11 | |
| Philip Bridson | Feb 9, 00:14 | |
| Herb Petschauer | Feb 9, 00:24 | |
| Philip Bridson | Feb 9, 00:25 | |
| Charles Steinman | Feb 9, 00:28 | |
| Herb Petschauer | Feb 9, 00:31 | |
| Herb Petschauer | Feb 9, 00:44 | |
| Philip Bridson | Feb 9, 00:49 | |
| Herb Petschauer | Feb 9, 00:55 | |
| Philip Bridson | Feb 9, 01:02 | |
| Herb Petschauer | Feb 9, 01:04 | |
| Philip Bridson | Feb 9, 01:09 | |
| Jens Miltner | Feb 11, 17:52 | |
| Scott Andrew | Feb 11, 18:06 | |
| Sean McBride | Feb 11, 19:34 | |
| Simone Tellini | Feb 11, 19:42 | |
| Scott Andrew | Feb 11, 19:52 | |
| Jens Miltner | Feb 12, 08:35 | |
| Uli Kusterer | Feb 12, 13:24 | |
| Thomas Engelmeier | Feb 13, 11:09 | |
| Uli Kusterer | Feb 13, 11:25 |






Cocoa mail archive

