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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:12:45+00:00 2026-05-29T09:12:45+00:00

I have build a C++ class that accepts a file path and file pattern

  • 0

I have build a C++ class that accepts a file path and file pattern from the user and searches for the file pattern in the provided location. Ex: C:\MyProject *.cpp lists all the .cp files in the given location.

I am able to build and compile the project successfully. Now I want to have a different Project called Executive which just contains a main() and does the same thing as the C++ class mentioned above.

Right now the structure looks like:

VS2010 Solution
  - Navigator
      -Headers
          f1.h
          f2.h
          f3.h
      -Source
          f1.cpp
          f2.cpp
          f3.cpp

Lets say I want to have another project under the same solution and called Main/Executive whose main purpose is to have a main function that does the same thing as the main in navigator project.

My question is that the Executive project under the same solution has main.cpp and probably will also need the copies of all the *.h files of the navigator project. Do I also need to copy the *.cpp file of navigator to the Executive project for main to work? Or should I just have main in Executive project and add hte Navigator project as a reference to the executive project?

  • 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-29T09:12:45+00:00Added an answer on May 29, 2026 at 9:12 am

    Open solution in Visual Studio, from New Project window select “Add to solution” option from that dropdown and name it Executive.

    Now when you have more projects under the same solution, you can go to properties of Executive project and in C/C++ -> General set Additional Include Directories to ../Navigator/Headers;../Navigator/Source;.

    And then in all source files of Executive project you can include .cpp files from Navigator project, for example: #include "f1.cpp". There is nothing wrong about including .cpp file.

    But, much better would be if you open Properties of Navigator project -> General, change Configuration type to Static library (.lib). And then in Executive project you set Additional Include Directories to ../Navigator/Headers; and in Linker -> General you set Additional Library Directories to the output folder of Navigator project (if you haven’t changed it’s output directory it is ../Debug for Debug configuration and ../Release) and in Linker -> Input you add ;Navigator.lib at the end of Additional Dependencies. Then in source files of Executive project you need to include .h files only. For making sure that Navigator project is built before Executive project when building whole solution, you can go to solution’s properties -> Project Dependencies and set there that Executive project depends on Navigator project.

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

Sidebar

Related Questions

I have a Silverlight application that is built from a set of Silverlight class
I have a User entity that has a Current Location field (city and country).
I have a class that builds a request based on a few passed in
I have a string that looks like this: Name1=Value1;Name2=Value2;Name3=Value3 Is there a built-in class/function
I have a set of source folders. I use a Java class to build
I have a dll which accepts a struct that contains a pointer to a
I'm trying to make a constructor for a graph class that accepts a string
I have a nested model structure that looks like this: resources :users, :path =>
I have a model, let's say Attachments, that uses attachment_fu to accept file uploads
I have a JAR file that contains an API that uses external model files.

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.