From: Stanislav K. <st...@uc...> - 2003-03-07 01:09:34
|
Ok, i have reduced my metaclass files and in the process found out that if I do not include iostream, comments work like a charm, but the minute that I do include iostream I start getting my compilation errors Here are my new files: //-------------------------------------- FILE: Makefile //-------------------------------------- small.o: small.cpp Meta.so occ -C -g -SMeta -- small.cpp Meta.so: Meta.mc Meta.h occ -C -m -g Meta.mc -I/home/wokls // ------------------------------------------------ // FILE: Meta.h // ------------------------------------------------ #include "openc++2.5.12/src/mop.h" #ifndef Meta_H #define Meta_H class Meta : public Class { public: //void TranslateClass(Environment *); void TranslateMemberFunction(Environment* env, Member& m); static bool Initialize(); }; #endif // ----------------------------------------------- // FILE: Meta.mc // ------------------------------------------------ #include "Meta.h" //#include <iostream.h> #include <stdio.h> bool Meta::Initialize() { Class::ChangeDefaultMetaclass ("Meta"); Class::SetMetaclassForFunctions("Meta"); return true ; } void Meta::TranslateMemberFunction(Environment * e, Member& m) { m.Comments()->Display(); } // ------------------------------------------------ // FILE: small.cpp // ------------------------------------------------ /* jfdklafdjaslkfdsa * fdsajkflasjflksafjdsal; * sadfjaskfjalskfjlas */ // hiu /* hi how are you doing? */ int main(void) { return 0; } // ------------------------------------------------ // ------------------------------------------------ // FILE: small.ii // ------------------------------------------------ # 2 "small.cpp" /* jfdklafdjaslkfdsa * fdsajkflasjflksafjdsal; * sadfjaskfjalskfjlas */ // hiu /* hi how are you doing? */ int main(void) { return 0; } # 23 "small.ii" // ------------------------------------------------ // ------------------------------------------------ // FILE: Meta.ii // ------------------------------------------------ Not included, because its huge when I include iostream, i get the following errors: occ -C -m -g Meta.mc -I/home/wokls /usr/include/g++-3/iostream.h:31: parse error before `32 "/usr/include/g++-3/iostream.h"' /usr/include/g++-3/iostream.h:272: parse error before `# 3' Meta.mc:6: parse error before `bool Meta' Meta.mc:10: parse error before `) ;' Meta.mc:11: parse error before `true ;' Meta.mc:14: parse error before `void Meta' Meta.mc:21: parse error before `' 7 Error(s). OpenC++ stops. make: *** [Meta.so] Error 1 thanks again Grzegorz Jakacki wrote: >On Wed, 5 Mar 2003, stan wrote: > > > >>How does one go about getting openC++ to retain comments? >> >>Gregorz Jakacki asked me to supply my *.occ >>files, what are these? >> >> > >I am sorry. I meant .ii files, the files which contain preprocessed and >translated sources, which are shipped to your underlying compiler. >Something like > > occ -E -SMeta -- Test.cpp > >should leave Test.ii in you working directory. Sorry for my mistake. Also, >if possible, send your source (Test.cpp) and the source of your metaclass. >Before you post, please reduce the size of Test.cpp to minimum size that >still gives you an error message. > >Best regards >Grzegorz > > > >>I am using: >>OpenC++ 2.5.12 >>GCC 2.96-85 on RH7.1 >> >>my make file looks like this: >> >>Test.o: Test.cpp Test.h Meta.so >> occ -g -c -SMeta -- Test.cpp >> >>Meta.so: Meta.mc Meta.h XMLWalker.o >> occ -m -g Meta.mc -I/home/uusaa XMLWalker.o >> >>XMLWalker.o: XMLWalker.cpp XMLWalker.h >> occ -c -g XMLWalker.cpp -I/home/uusaa >> >>my XMLWalker, walks the ast spitting out xml as it goes. >> >>I tried inserting the -C option into the occ compile commands and when I >>do this, >>i get the following errors: >> >>occ -C -g -c -SMeta -- Test.cpp >>/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/new:35: parse error before `36 "/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/new"' >>/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/new:44: parse error before `} ;' >>/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/new:54: parse error before `void *' >>/usr/lib/gcc-lib/i386-redhat-linux/2.96/include/new:67: parse error before `# 34' >>/usr/include/g++-3/iostream.h:31: parse error before `32 "/usr/include/g++-3/iostream.h"' >>/usr/include/g++-3/iostream.h:272: parse error before `# 54' >>/usr/include/g++-3/stl_alloc.h:344: parse error before `_Obj *' >>/usr/include/g++-3/stl_alloc.h:351: parse error before `void *' >>/usr/include/g++-3/stl_alloc.h:398: parse error before `: static' >>/usr/include/g++-3/stl_alloc.h:406: parse error before `( __n' >>10 Error(s). OpenC++ stops. >>make: *** [Test.o] Error 1 >>any ideas? >> >>thanks >> >> >> >> >> > >################################################################## ># Grzegorz Jakacki Huada Electronic Design # ># Senior Engineer, CAD Dept. 1 Gaojiayuan, Chaoyang # ># tel. +86-10-64365577 x2074 Beijing 100015, China # ># Copyright (C) 2002 Grzegorz Jakacki, HED. All Rights Reserved. # >################################################################## > > > > |