The second thing, #include foo.hpp... actually tried both, foo.hpp or foo.cpp. not at the same time, of course. It is in the project Source folder.
Among other errors, I may have chosen the wrong Xcode template to do this project. It really is a DLL written in c and c++, may not need to remain as a DLL on the Macintosh.
Ahhhh... silly me, thinking that #include of a header file would be like Pascal Uses, given the importance of the file suffices.....
Many thanks, Sherm, for the insight and reading links. I will be busy checking them out.
Gary On Sep 10, 2008, at 9:36 AM, Sherm Pendley wrote: 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
|