I had struct errorStruct & a queue errQueue definition in yacc.y , then moved it to separate .h file
but it gives me linking error that the definition is found in both y
I believe you should organize the code as:
yacc.h //-----> should have declaration of errQueue & errorStruct
yacc.cc //-----> should include yacc.h,
//It can create variables of type errQueue & errorStruct
node.cc //-----> should include yacc.h
//It can create variables of type errQueue & errorStruct
Note that the declarations should only be present in yacc.h
and it should be included in all your cc files which need to create instances of the said types, If the structures are declared in any of your cc file in addition to the header(yacc.h) then you will end up getting the redefinition errors you mentiones.
opss! I forgot to post the answer .. sorry ..
got it with the help of @Peter K.'s reference :
go to VS : project -> property page -> configuration properties -> linker ->command line
and add /FORCE:MULTIPLE
in additional options box