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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:15:53+00:00 2026-06-11T20:15:53+00:00

I wrote a test.cpp: #include <iostream> #include <stack> #include <boost/lexical_cast.hpp> #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp>

  • 0

I wrote a test.cpp:

      #include <iostream>
      #include <stack>
      #include <boost/lexical_cast.hpp>
      #include <boost/config/warning_disable.hpp>
      #include <boost/spirit/include/qi.hpp>
      #include <boost/spirit/include/phoenix.hpp>

      using namespace std;
      namespace phoenix = boost::phoenix;
      namespace qi = boost::spirit::qi;
      namespace ascii = boost::spirit::ascii;

     struct calculator
     {
      bool interpret(const string& s);
      void do_neg();
      void do_add();
       void do_sub();
      void do_mul();
        void do_div();
        void do_number(const char* first, const char* last);
          int val() const;
      private:
      stack<int> values_;
      int *pn1_, n2_;
      void pop_1();
      void pop_2();
      };
     ......................
     ....................

But when I use g++ test.cpp -o test, there are errors like boost/lexical_cast.hpp: No such file or directory, but I have copy all of files in boost (download from boost.org) to the test.cpp folder, how to make g++ know the headers paths? Thanks

I used g++ test.cpp -o test

Using " " is not possible, I have a lot of header’s dependency.

  • 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-11T20:15:54+00:00Added an answer on June 11, 2026 at 8:15 pm

    You have to make sure you modify the include to g++’s command. Reading from the man page (which is your best friend for this sorta stuff):

    Add the directory dir to the list of directories to be searched for
    header files.  Directories named by -I are searched before the
    standard system include directories.  If the directory dir is a
    standard system include directory, the option is ignored to ensure
    that the default search order for system directories and the
    special treatment of system headers are not defeated .  If dir
    begins with "=", then the "=" will be replaced by the sysroot
    prefix; see --sysroot and -isysroot.
    

    For you the command should look like this:

    g++ -I path/to/boost test.cpp
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a small test program I wrote: #include <iostream> using namespace std; class A
I have a sample program in a file called helloworld.cpp: #include <iostream> using namespace
I wrote a feature to test the default configuration of my web app using
I wrote a very simple test code of printf uint64_t: #include <inttypes.h> #include <stdio.h>
all I write this cpp code to test the stack and head. And I
I wrote the following piece of code to test Xyz::xyz_func by mocking Abc::abc_func using
Take the following simple source (name it test.cpp): #include <windows.h> void main() { DebugBreak();
Hї! I have wrote test for my application. I need add item to database
I wrote a test program to monitor my Picture folder which points to c:\users[username]\Pictures
I wrote a test program thinking that the address of p1 will be less

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.