Jochen K�pper wrote: > > Dear All, > > I am using g++ and libg++ for software development. > > PROBLEM: > ======== > > I am trying to put some arrays into a library, one of the array is > defined as: > > #include > const string symbol[] = { " ", > "h ", "he", "li", "be", "b ", > "c ", "n ", "o ", "f ", "ne", > "na", "mg", "al", "si", "p ", > "s ", "cl", "ar" > }; > > If I put that into an object file archive, everything is working as > expected, but if I create a dynamic link library, I get a > segmatation fault whenever I try to access the array. But the > array is in the library: > > Jochen, how are you building the DLL? Your problem sounds like the initialization routine for that array is never called. On our (SGI) platform, the rule is to use the C++ compiler to link the library. Martin -- +---------------------------------+-----------------------------------+ |Martin Knoblauch | Silicon Graphics GmbH | |Manager Technical Marketing | Am Hochacker 3 - Technopark | |Silicon Graphics Computer Systems| D-85630 Grasbrunn-Neukeferloh, FRG| |---------------------------------| Phone: (+int) 89 46108-179 or -0 | |http://reality.sgi.com/knobi | Fax: (+int) 89 46107-179 | +---------------------------------+-----------------------------------+ |e-mail: | VM: 6-333-8179 | M/S: IDE-3150 | +---------------------------------------------------------------------+