Re: Global arrays mutiply defined in 4gl
Posted in 2006
On 12/1/06, sergio@moredata.pt <sergio@moredata.pt> wrote: > When I define an array inside GLOBALS statement in two modules the linker > tells me that the symbol is multiply defined. > > This just happens to arrays (records and primitive data types are ok) > because in the generated C it have a initialization. > > Does anyone know how to tell to c4gl to do not initialize the array(s) ? You do it by using the GLOBALS "globals.4gl" notation in all files that need the globals. You can have multiple GLOBALS "filename.4gl" entries in a file if need be. Each included globals.4gl file also needs to be compiled separately to provide the definitions of the variables (instead of the declarations used when you use the GLOBALS "globals.4gl" notation). Basically, anything else is wrong - you are lucky if it ever worked. If you have DATETIME or INTERVAL types in the data, they are initialized - which means you end up with multiple definitions of the data. > I know that if I use a globals file it works, but my customer have a > strange code generation process. Fix the broken as well as strange code generation process - you are trying to ask I4GL to do what it is designed not to do. -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/