Option "Use debug Dcu's" causes compiler error - Delphi

This is a discussion on Option "Use debug Dcu's" causes compiler error - Delphi ; Hi all, When I check the option "Use debug DCU's" in D7 Ent I get a compiler error saying "[Fatal error] Variants.pas (1024): Program or unit 'Variants' recursively uses itself" The compiler stops at the last line in the source ...

+ Reply to Thread
Results 1 to 3 of 3

Option "Use debug Dcu's" causes compiler error

  1. Default Option "Use debug Dcu's" causes compiler error

    Hi all,

    When I check the option "Use debug DCU's" in D7 Ent I get a compiler error saying

    "[Fatal error] Variants.pas (1024): Program or unit 'Variants'
    recursively uses itself"

    The compiler stops at the last line in the source unit Vairants (see code far
    below). If I uncomment the code in "procedure VarCopyByRef" then the cursor
    stops way down at line 2809 instead.

    Why is it doing like this? This means I can't debug using Dcu's (well, you
    already guessed that...).

    Regards,

    // Rolf Lampa



    Unit Variants;
    ....
    procedure VarCopyByRef(var Dest: TVarData; const Source: TVarData);
    begin
    case Source.VType and not varByRef of
    varSmallint: Variant(Dest) := PSmallint(Source.VPointer)^;
    varInteger: Variant(Dest) := PInteger(Source.VPointer)^;
    varSingle: Variant(Dest) := PSingle(Source.VPointer)^;
    varDouble: Variant(Dest) := PDouble(Source.VPointer)^;
    varCurrency: Variant(Dest) := PCurrency(Source.VPointer)^;
    varDate: Variant(Dest) := PDate(Source.VPointer)^;
    varOleStr: Variant(Dest) := VarCopyNoIndOleStr(Source);
    varBoolean: Variant(Dest) := PWordBool(Source.VPointer)^;
    varShortInt: Variant(Dest) := PShortInt(Source.VPointer)^;
    varByte: Variant(Dest) := PByte(Source.VPointer)^;
    varWord: Variant(Dest) := PWord(Source.VPointer)^;
    varLongWord: Variant(Dest) := PLongWord(Source.VPointer)^;
    varInt64: Variant(Dest) := PInt64(Source.VPointer)^;

    varVariant: _VarCopyNoInd(Dest, PVarData(Source.VPointer)^);

    varDispatch,
    varUnknown: VarCopyNoIndViaOS(Dest, Source);
    else
    if Source.VType and varArray <> 0 then
    VarArrayCopyForEach(Dest, Source, VarCopyNoIndCopyProc)
    else
    VarCopyNoIndDeep(Dest, Source);
    end
    end; <-- # error places cursor here! (1024)

    or:

    procedure VarStrCat(var Dest: Variant; const Source: Variant);
    begin
    if TVarData(Dest).VType = varString then
    Dest := string(Dest) + string(Source)
    else
    Dest := WideString(Dest) + WideString(Source);
    end; <-- # error places cursor here! (2809)

  2. Default Re: Option "Use debug Dcu's" causes compiler error

    Rolf Lampa [RIL] wrote:

    > Hi all,
    >
    > When I check the option "Use debug DCU's" in D7 Ent I get a compiler
    > error saying
    >
    > "[Fatal error] Variants.pas (1024): Program or unit 'Variants'
    > recursively uses itself"


    That indicates that you have the Delphi source folders on your library
    path or the projects search path, so the compiler tries to recompile
    them. Remove them, they have no reason to be there. The source folders
    should only be on the browsing path.



    --
    Peter Below (TeamB)
    Don't be a vampire (http://slash7.com/pages/vampires),
    use the newsgroup archives :
    http://www.tamaracka.com/search.htm
    http://groups.google.com

  3. Default Re: Option "Use debug Dcu's" causes compiler error

    Peter Below (TeamB) wrote:
    > Rolf Lampa [RIL] wrote:


    >> When I check the option "Use debug DCU's" in D7 Ent I get a compiler
    >> error saying
    >>
    >> "[Fatal error] Variants.pas (1024): Program or unit 'Variants'
    >> recursively uses itself"

    >
    > That indicates that you have the Delphi source folders on your library
    > path or the projects search path, so the compiler tries to recompile
    > them. Remove them, they have no reason to be there. The source folders
    > should only be on the browsing path.



    Ahh, yes, so it was. Thanks!

    Regards,

    // Rolf Lampa

+ Reply to Thread