-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ron,
I direct you to the ops original question:
>Hi there,
>
>Now I'm writing code mainly in C++. And some existing c code
>will call some functions which are in a C++ class. I read the basic
>techniques introduced from a SUN's web site.
>Basically
>1. we can add extern "C" keyword, or
>2. use the object in C++ code as struct in C.
In Mike's case, you do indeed need to be able to initialize a class
prior to utilize its "functions" unless they are static... even then,
I'm sure someone will come up with a case where a static needs
initialization. And, while he didn't expressly state his question in
these terms (likely because he didn't know what questions to ask) The
following issues are implied:
1. How precisely do you use extern "C" {} in such a cross language project?
2. How would you use C++ objects or types not found in C from C?
3. Once you have solved the previous two issues, how do you link the
resulting object code (tool chain specific unfortunately).
I can see that #3 from above will be of particular interest to Mike as
he says "I read the basic techniques introduced from a SUN's web site."
Having plied this particular pathway myself not too long ago, I can say
that info for this technique is sadly in short supply. I myself had to
write to the authors of C/C++ Users Journal to get all the issues in
hand after an article appeared in one of their previous issues which
touched on the subject. For this reason, when helping others get through
this subject, I provide a working project which gives the developer in
question a good idea of the plumbing in question.
I can also say that due to this simple project, I have received several
thank you emails off group. I have to say, that's a good feeling.
Please note, as with most news groups, there is a minimum expectation of
decorum which I, speaking for the rest of us, would hope you could see
your way to adhering to. Otherwise, well, I expect others like myself
will simply put your address in our kill files.
Ron Natalie wrote:
> "Evan Carew" <[email protected]> wrote in message news:102e (e-mail address removed)...
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>
> Thanks fo the gratuitous and ignorant answer. I am quite aware you can
> wrap C++ functiosn in extern C functions. That wasn't the question the
> user asked (nor the one I answered).
>
> I have no desire to get your lousy GCC programs via mail or otherwise.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org
iD8DBQFALWaVoo/Prlj9GScRAkoTAJ94aDdBWZxsqlBCOplrQs4cmIm5QQCfTUJy
3qvVjov8yyfmJv5HtxMSftk=
=NN7b
-----END PGP SIGNATURE-----