I have run into this issue with a FILE in an INC file included by multiple CLASS CLWs showing Duplicate Symbol errors. Jeff ran into with a Class Module QUEUE also and reported it in PTSS. These should be encapsulated by the Class and Private, but they are Not.
I have no simple fix. An easy thing to do is copy the INC file and give the File a unique Label and Prefix. You could have 1 common INC file with all the Fields. The âUniqueâ INC would need the FILE line and KEYs. Unfortunately the KEY( field )
declarations must have the Prefix i.e. KEY( Pre:field )
. Wish the PRE was not required on KEY fields.
There were too many Files and Classes to do my âeasy thingâ above. What I did was made a separate Project and compiled each Class into an separate DLL. That works but did create 25 Projects and DLLs.
Hereâs the contents of a Bug report I submitted and the bug demo project. Maybe @anon77170705 knows of a way to make a Class File Private.
I attached a project that shows a problem Iâve run into on conversion of C6 to 11.1 .13815, this code worked fine in C6. If 2 classes declare the same FILE the KEYs throw Duplicate Symbol errors. Compile the attached to see these errors:
If you comment out the Keys in Class_File_Def_Courses.INC then you do not get the KEY Dup Errors. Also ⌠there are 2 Key &= Refs in the Class CLW code youâll need to comment out for a clean compile.
The only workaround I know is to use a Unique file name and PRE().
This is a BIG Limitation if a Clarion Class cannot declare a FILE in the Class Module CLW without worrying about what FILEs are declared in all the other Classes in the Project. The Class Module data is supposed to be Local ?
Class 1 and 2 are identical except for the name. They both Include a File INC
MEMBER() !ClassWithFile1.CLW Class ONE
INCLUDE('ClassWithFile1.INC'),ONCE
!This Class 1 needs to Access this COURSES File. If this is also in another Class there are Duplicates on the KEYs
INCLUDE('Class_File_Def_Courses.INC'),ONCE !<== the FILE in here
Class 2 is the same except â2â changes to â1â
MEMBER() !ClassWithFile2.CLW Class TWO
INCLUDE('ClassWithFile2.INC'),ONCE
!This Class 2 needs to Access this COURSES File. If this is also in another Class there are Duplicates on the KEYs
INCLUDE('Class_File_Def_Courses.INC'),ONCE !<== the FILE in here
FILE defined in Class_File_Def_Courses.INC
Courses FILE,DRIVER('TOPSPEED'),PRE(COU2),CREATE,BINDABLE,THREAD
KeyNumber KEY(COU2:Number),NOCASE,OPT,PRIMARY ! Remove PRE: ? Nope!
KeyDescription KEY(COU2:Description),DUP,NOCASE
CompleteDescription MEMO(1000)
Record RECORD,PRE()
Number LONG
Description STRING(40)
END
END
Bug Demo Project
BugDupKeys_ClassesWithSameFile.zip (4.6 KB)