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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:20:56+00:00 2026-06-05T11:20:56+00:00

I have two mutually dependent header files: BarP.h and addNewProductForm.h, built using Microsoft CLR

  • 0

I have two mutually dependent header files: BarP.h and addNewProductForm.h, built using Microsoft CLR components, which look something like this (they are way too long to include intact):
BarP.h:

#pragma once

#include "addNewProductForm.h"
#include "editBarOptionsForm.h"
#include "editDecayParamsForm.h"
#include "editExistingItemForm.h"
#include <math.h>
#include <string>
#include <iostream>
#include <fstream>
#include <msclr\marshal.h>


namespace BarPricer3 {

    using namespace std;
    using namespace System;
    using namespace System::ComponentModel;
    using namespace System::Collections;
    using namespace System::Windows::Forms;
    using namespace System::Data;
    using namespace System::Drawing;
    using namespace msclr::interop;

ref struct productDat{...};
productDat^ createProduct(String^ name,double firstPrice,double lastPrice,double lastDemand){...};
public ref class BarP{
    ...
    private: System::Void createNewProductForm(...){
        BarPricer3::addNewProductForm^ newProductForm = gcnew addNewProductForm;
        newProductForm->ShowDialog(this);
    }
}

addNewProductForm.h

#pragma once

#include "BarP.h"
#include <fstream>

namespace BarPricer3 {

using namespace std;
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;

public ref class addNewProductForm{
        ...
    private: System::Void createNewProduct(...){
         productDat^ theNewP = createProduct(this->name->Text,Convert::ToDouble(this->firstPrice->Text),Convert::ToDouble(this->lastPrice->Text),Convert::ToDouble(this->lastDemand->Text));
        ...
    }
}

When I try to compile, I get the following errors:
Error 8 error C2039: ‘addNewProductForm’ : is not a member of ‘BarPricer3’ d:…\BarP.h 690 (line 32 in my code)
Error 15 error C2065: ‘productDat’ : undeclared identifier d:…\addNewProductForm.h 181 (line 19 in my code)

Can I get any advice about what’s happening here?

  • 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-06-05T11:20:57+00:00Added an answer on June 5, 2026 at 11:20 am

    You have a circular inclusion in the header files, and that, combined with the #pragma once directive, is what yields the error. You need to remove one of the includes (or both) and replace them with a forward declaration (might want to google this).

    You’ll probably need to separate the implementations to a different file, because you use the types inside the headers.

    Your problem is that addNewProductForm.h uses productDat which is defined in BarP.h, and that BarP.h uses addNewProductForm which is defined in addNewProductForm.h. (These are the classes that will need to be forward-declared).

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

Sidebar

Related Questions

Have two files with struct definitions. Header: typedef struct _InputData InputData; extern InputData input_data;
Have two errors which relate to implementation. Have commented out the errors. Header file:
Have two folders with approx. 150 java property files. In a shell script, how
I have an ASP.NET application which needs to search a VARCHAR(20) column using lists
Have two IBOutlets which won't appear in File's Owner to connect to even though
I have two date picker components and a JComboBox component with their associated Action
I have two files from a C program. I guess both belong to quite
I have two classes (MVC view model) which inherits from one abstract base class.
I have two files client.php and server.php. The client file send a HTTP request
We have two identical installations of CF9 (C:/inetpub/wwwroot/cfide/...) using the FCKeditor. One is the

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.