1. Open Watcom and Open Eu
- Posted by Al Getz <Xaxo at aol.com> Sep 20, 2006
- 553 views
Hello again, Now that Eu will be open, many of us will be using Open Watcom to compile our personal versions so here is a question... The C++ keyword 'static' when used at file level is supposed to keep a variable visible to that file only, yet it doesnt seem to work, because even if you define a var as static in one file if you go to define it in another file (also as static) the compiler complains. Example: //in file A.h: static abc; //in file B.h: static abc; This generates compiler error: " abc already defined " !!! Any ideas? Take care, Al E boa sorte com sua programacao Euphoria! My bumper sticker: "I brake for LED's" From "Black Knight": "I can live with losing the good fight, but i can not live without fighting it". "Well on second thought, maybe not."
2. Re: Open Watcom and Open Eu
- Posted by Matt Lewis <matthewwalkerlewis at gmail.com> Sep 20, 2006
- 552 views
Al Getz wrote: > > Hello again, > > Now that Eu will be open, many of us will be using Open Watcom > to compile our personal versions so here is a question... > > The C++ keyword 'static' when used at file level is supposed > to keep a variable visible to that file only, yet it doesnt > seem to work, because even if you define a var as static > in one file if you go to define it in another file (also as > static) the compiler complains. > > Example: > > //in file A.h: > static abc; > > //in file B.h: > static abc; > > This generates compiler error: > " abc already defined " !!! > > Any ideas? I think you're confusing C with C++. Here's a page about the topic: http://www.everything2.com/index.pl?node_id=1347400 It sounds like you're writing C code, but compiling as C++ (Open Watcom uses file extension to determine the language). Matt Lewis
3. Re: Open Watcom and Open Eu
- Posted by Al Getz <Xaxo at aol.com> Sep 20, 2006
- 553 views
Matt Lewis wrote: > > Al Getz wrote: > > > > Hello again, > > > > Now that Eu will be open, many of us will be using Open Watcom > > to compile our personal versions so here is a question... > > > > The C++ keyword 'static' when used at file level is supposed > > to keep a variable visible to that file only, yet it doesnt > > seem to work, because even if you define a var as static > > in one file if you go to define it in another file (also as > > static) the compiler complains. > > > > Example: > > > > //in file A.h: > > static abc; > > > > //in file B.h: > > static abc; > > > > This generates compiler error: > > " abc already defined " !!! > > > > Any ideas? > > I think you're confusing C with C++. Here's a page about the topic: > > <a > href="http://www.everything2.com/index.pl?node_id=1347400">http://www.everything2.com/index.pl?node_id=1347400</a> > > It sounds like you're writing C code, but compiling as C++ (Open > Watcom uses file extension to determine the language). > > Matt Lewis Hi Matt, Yes, that's what i thought too, but everything else seems to work as if cpp so i figured it was using cpp to compile. The code resides in an .h file, so perhaps i need to make the file name extension .hpp instead? Take care, Al E boa sorte com sua programacao Euphoria! My bumper sticker: "I brake for LED's" From "Black Knight": "I can live with losing the good fight, but i can not live without fighting it". "Well on second thought, maybe not."