Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:09:16+00:00 2026-05-26T09:09:16+00:00

I am writing a Delphi 2010 application. It has many files, two of which

  • 0

I am writing a Delphi 2010 application. It has many files, two of which are called Utils_ABS and Utils_MAT. I have created a record type that both files need to understand, so I put it in its own file, called TypeDefs.inc.

At the top of both Utils_MAT and Utils_ABS, I have INCLUDED TypeDefs.inc.

unit Utils_ABS;

interface

{$WARNINGS ON}
{$HINTS ON}
{$WARN UNIT_PLATFORM OFF}
{$WARN SYMBOL_PLATFORM OFF}

uses
Windows, Messages, ... Utils, Analysis, UserFeedback, Utils_MAT;

{$I TypeDefs.inc}     // Include TypeDefs that are used multiple places

procedure ABS_Load;
...

Utils_MAT looks very similar, especially as relates to {$I TypeDefs.inc}.

The key item is that both files reference a third file, TypeDefs.inc, as an INCLUDE, which has the definition of a RECORD:

type
TTableAttrType = Record
tabIOT: Boolean; // Is table an IOT
...
end;

There is nothing else but this one record definition in this file.

The problem is that when I compile, I get the following error:

[DCC Error] Utils_ABS.pas(212): E2010 Incompatible types: ‘Utils_ABS.TTableAttrType’ and ‘Utils_MAT.TTableAttrType’

I am totally confused. How can they be incompatible types if they come from the same definition? Not a copy of the definition, but literally the same definition.

I have checked all my source code, and this TTableAttrType record is not defined anywhere else.

I have tried to comment out the $INCLUDE, and hard-code the definition of the record into both Utils_ABS and Utils_MAT, but I still get the same error.

How do I get this error to go away?
How do I define a record structure in one place, and have multiple files access it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:09:17+00:00Added an answer on May 26, 2026 at 9:09 am

    By including the definition like this, you are defining the type in both units. Since Pascal (and by extension Delphi) uses a nominative type system, rather than a structural type system, the two types are not the same – they have different names, as shown in the error message.

    Put the definition of TTableAttrType in a separate unit, and throw that new unit into the uses clause of the interface section in the two other units. Then the type will only be defined once, and you will no longer have incompatible types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing an application which can copy files on a network share. Usually the
I'm writing an application in Delphi 2010, and I'd like to provide the option
I'm writing delphi app which should have capability of loading plugins. I'm using JvPluginManager
I'm writing a Delphi 7 application which needs to access the same SQL Server
I'm writing an application in Delphi which uses an SQLite3 database. I'd like to
I am writing a windows application in Lazarus/FreePascal (like Delphi). I have a TDataset
I have started writing web services in Delphi 2010 and am unit testing to
I have a lot of experience writing Delphi 6 Pro apps using the Skype
I am writing a program using Delphi 2006 and storing data in XML files
I'm writing a tcp client in Delphi for a server that has a series

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.