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

  • Home
  • SEARCH
  • 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 6693531
In Process

The Archive Base Latest Questions

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

I have a C++ project in Visual Studio 2008. In the project I have

  • 0

I have a C++ project in Visual Studio 2008.

In the project I have several forms and several non-form classes. One non-form specifically called Import_LP.h that is a class with several methods all of which are written in the header file with nothing in the resource file.

I have no problem with #include Import_LP in any of the form classes and creating objects and referencing any of its methods, however any other class I try to #include it into, it gives me a

syntax error : undeclared identifier 'Import_LP'

on the line it is referenced occurs ie Import_LP^ importLP;

I come from a java/c# background is there something I’m missing with the linking 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-05-26T05:59:37+00:00Added an answer on May 26, 2026 at 5:59 am

    If you have include guards, it goes like this: the preprocessor includes Import_LP.h, which says “only include me once”, then includes Window.h, which tries to include Import_LP.h, but doesn’t because of the include guard. So Window.h starts parsing the window class, but fails because the Import_LP.h class header hasn’t fully loaded yet.

    The solution is to predeclare the classes:

    Window.h:

    #ifndef WINDOW_H  //works best if this is first
    #define WINDOW_H
    #pramga once
    
    class Import_LP;
    class Window {
        Import_LP* member; //member has to be a pointer
        void func();
    };
    #include "Import_LP.h"
    inline void Window::func() {  
    }
    #endif WINDOW_H
    

    Import_LP.h:

    #ifndef IMPORT_LP_H //works best if this is first
    #define IMPORT_LP_H 
    #pramga once
    
    class Window;
    class Import_LP {
        void func(Window& parent); //parameter has to be a pointer or reference
    };
    #include "Window.h"
    inline void Import_LP::func(Window* parent) {  
    }
    #endif IMPORT_LP_H 
    

    This will only allow you to reference the other by pointer or reference until the actual include, but that should be doable. Technically you only have to do this to one or the other headers.

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

Sidebar

Related Questions

I have a Visual Studio 2008 solution with several projects. One project is a
I have a Windows Forms project in Visual Studio 2008, which references a library
I have a fully working Setup project within Visual Studio 2008 that takes inputs
In Visual Studio 2008 I have a Class Library project (called Media ) to
I have a VB.NET project in Visual Studio 2008 that I created a specialized
I have a Visual Studio (2008) solution consisting of several projects, not all in
In our team we have a database project in visual Studio 2008 which is
I have created a setup project using Visual Studio 2008. After the application is
I have a Web Application project in Visual Studio 2008. (lucky you, you say?
I have a WPF VB.NET project in Visual Studio 2008. For some reason, Visual

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.