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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:29:43+00:00 2026-06-13T04:29:43+00:00

sorry for my bad english. For example : // // File : Main.cpp //

  • 0

sorry for my bad english.

For example :

//
// File : Main.cpp
// 
#include <stdlib.h>
int main()
{
  printf(TEST_DEFINE);
  return (EXIT_SUCCESS);
}

Header :

//
// File : test_define.h
//
#ifndef TEST_DEFINE_H_INCLUDED
#define TEST_DEFINE_H_INCLUDED

#define TEST_DEFINE

#endif

I want include that header, by the compiler or other program. I not want include this header in CPP file.

How can i process ? I’m open to all proposal.

This situation is quite tricky, but necesary for my POC program.

  • 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-13T04:29:44+00:00Added an answer on June 13, 2026 at 4:29 am

    GCC has an option -include file which causes the preprocessor to include the header as though the first line of your program said #include "file"

    See the manual

    e.g. given a fixed version of your main (which should #include <stdio.h>):

    #include <stdlib.h>
    #include <stdio.h>
    int main()
    {
      printf(TEST_DEFINE);
      return (EXIT_SUCCESS);
    }
    

    and your header:

    //
    // File : test_define.h
    //
    #ifndef TEST_DEFINE_H_INCLUDED
    #define TEST_DEFINE_H_INCLUDED
    
    #define TEST_DEFINE "hello\n"
    
    #endif
    

    Then I can use it like this:

    $ g++ -include test_define.h main.cpp -o main
    $ ./main
    hello
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for my bad English. I have a log file from a Web server
Sorry for bad English :( Suppose i can preliminary organize recipes and ingredients data
Sorry for bad english and bad title! I have the table post id title
At first sorry my bad English. I want define routing for this url: For
at first sorry my bad English I want load model in my plugin controller
Sorry for my bad English. Just like what I asked. I have this class
Hello (Sorry for my bad English) Is it bad practice to assign object to
First of all sorry for my bad english and Im pretty new in these
First, sorry for my bad English. I've an app which is installed on multiple
First, sorry for my bad english, I'm French. Here the problem : I have

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.