TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MATHIEU BOUCHARD
from: JARI LAAKSONEN
date: 1997-09-08 21:50:00
subject: !!StackControl???

AT>>> extern unsigned _stklen = 10000;
BP>> In C++ it probably must be declared as extern "C" unsigned ...
MB> extern "C" makes only sense with functions.
Some compilers generate mangled names for variables, too. Try this with and 
without TEST defined:
================ Begin G.H ===============
#ifdef TEST
#ifdef __cplusplus
extern "C" {
#endif
#endif
extern const char *global_string;
#ifdef TEST
#ifdef __cplusplus
}
#endif
#endif
================ End   G.H ===============
================ Begin G.Cpp ===============
#include "g.h"
const char *global_string = "string";
================ End   G.Cpp ===============
================ Begin Test.C ===============
#include 
#include "g.h"
int main (void)
{
  printf ("global_string = %s\n", global_string);
  return 0;
}
================ End   Test.C ===============
        // Albert                      email: jla@to.icl.fi
--- GoldED/2 2.50+
---------------
* Origin: Albert's Point/2 in Finland, Europe (2:221/360.20)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.