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 6688651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:25:40+00:00 2026-05-26T05:25:40+00:00

I have an Objective-C++ project in Xcode which compiles fine when on the normal

  • 0

I have an Objective-C++ project in Xcode which compiles fine when on the normal build scheme, but when I compile for Archive, Analyze or Profile I get the compile error:

Must use ‘class’ tag to refer to type ‘Line’ in this scope

This is a very much simplified version of my code:

class Document;

class Line
{
public:
    Line();

private:
    friend class Document;
};

class Document
{
public:
    Document();

private:
    friend class Line;
};

The errors occur anywhere I try to use the type Line. Eg.

Line *l = new Line();

Do you know how to fix this error message and why it only appears when compiling in one of the schemes listed above?

  • 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-26T05:25:40+00:00Added an answer on May 26, 2026 at 5:25 am

    I managed to fix the issue by refactoring the ‘Line’ type name into something else. The only explanation I can think of is that when performing and Archive build, Xcode compiles in some external source which defines another ‘Line’ type. Hence it needed the ‘class’ specifier to clarify the type.

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

Sidebar

Related Questions

I have an xcode Objective-C iPhone static library project. When I build it in
In Objective-C xcode project I have a plist file with which associates integers with
I have an iPhone project (Xcode, Objective C++) with two targets - A and
I have an Xcode project which builds a Cocoa desktop Browser application. My Browser
I have an objective-c/xcode project with several header and implementation files. I'd like to
In an Xcode project I have a C file with functions, it compiles and
I am working on a simple project in Objective-C in Xcode, and I'm getting
when I compile my app project via Xcode, I got too many warning, most
I have created a Command Line Utility C++ tool in XCode using Objective-C. I
I'm writing an iPhone app in Objective-C with Xcode and I have some Lua

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.