Kent Watsen (watsen++at++coryphaeus.com)
Thu, 30 Nov 95 10:54:53 -0800
Ah, but the final link doesn't have to be performed be CC, as the code
following demonstrates:
test.c++:
#include <iostream.h>
extern "C" { void test_cpp(void); }
void test_cpp(void
{
Iostream_init tmp;
cout << "testing" << endl;
}
main.c:
#include <stdio.h>
extern void test_cpp(void);
main()
{
printf ("test before\n");
test_cpp();
printf ("test after\n");
}
% CC -c test.c++
% cc main.c test.o -lC
% a.out
test before
testing
test after
Without the instantiation of an Iostream_init the program would
have incurred a segmentation fault. Note that the instantiation
of the Iostream_init could not have been done globally (as CC
would do for you).
___________________________________________
-------------------------------------------
|| || || Kent Watsen || || ||
|| || || Coryphaeus Software || || ||
|| || || 408.395.4537 x223 || || ||
|| || || watsen++at++coryphaeus.com || || ||
/-------------------------------------------\
-------------------------------------------------------------------------
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:04 PDT