Re: bringing windows c++ code to Macintosh
Re: bringing windows c++ code to Macintosh
- Subject: Re: bringing windows c++ code to Macintosh
- From: "Sherm Pendley" <email@hidden>
- Date: Wed, 10 Sep 2008 12:36:12 -0400
On Wed, Sep 10, 2008 at 4:54 AM, M Pulis
<email@hidden> wrote:
Ok, thats a problem. Only the .hpp or .cpp was included, not both.
I'm not certain we're talking about the same thing. When you say "included," what are you referring to? Including a file in the Xcode project? Or using an #include macro in your code? I'm talking about the second.
So, given Foo.cpp and Foo.hpp, to be used from main.m, what should main.m look like?
In main.m, you would #include "Foo.hpp", but you would *not* #include any .cpp, .m, .mm, .c, or any other source files - #include is for headers only. In Pascal terms, if I remember them correctly, interface and implementation blocks are split into separate header and source files, respectively.
The files are split like this because, unlike Pascal's "using", the #include used by C and its relatives is just a macro - you can think of '#include "filename"' as "{$I filename}".
There's a couple of old articles at MacTech that may help - the "Pascal Programmer's Guide to Understanding C":
There's also a book on the subject, titled "C++ For Pascal Programmers":
Hope this helps!
sherm--
--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________
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