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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:49:25+00:00 2026-05-28T06:49:25+00:00

I have this file: // File.cpp int main() { FuncToChange(4, 6, 9, 12); }

  • 0

I have this file:

// File.cpp

int main() {
   FuncToChange(4, 6, 9, 12);
}

Now, I need to obtain this behaviour:

// Config.h

#define FuncToChange($1, $2, $3, $4) NewFunc($1, $3, $4)

// File.cpp

#include "Config.h"

int main() {
   FuncToChange(4, 6, 9, 12);
}

How can I do it without modifying the original “File.cpp” file, i.e. without explicitly #include “Config.h”?

Is it possible to force a header inclusion either from the makefile or from the IDE (CodeBlocks in this case)?

Thank you!

Platform:
CodeBlocks 10.05
GCC/MinGW
Windows 7

  • 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-28T06:49:26+00:00Added an answer on May 28, 2026 at 6:49 am

    From the GCC page on preprocessor options page:

    -include file
        Process file as if #include "file" appeared as the first line of the
        primary source file. However, the first directory searched for file is
        the preprocessor's working directory instead of the directory containing
        the main source file. If not found there, it is searched for in the remainder
        of the #include "..." search chain as normal. If multiple -include options
        are given, the files are included in the order they appear on the command line. 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one file example1.cpp with the main function. This file must have #include
I have this C++ file: #include <iostream> int main(int argc, char *argv[]) { std::cout
I have a (partial) qmake project file like this: TEMPLATE=lib TARGET=whatever SOURCES=whatever.cpp HEADERS=whatever.h This
I have this file structure: folderIWantStuffIn/ - old_stuff Now I want to add some
I have this source file: // ConstPointer.cpp const short * const const_short_p_const = 0;
I have a sample c file called itoa.cpp as below: #include <stdio.h> #include <stdlib.h>
I found this sample code on the msdn library #include <iostream> int main() {
In the file test.cpp, I have this: template <typename T> class A { public:
I have a file named test1.cpp namespace a { int main1() { return 3;
I have this file file.txt which I want to split into many smaller ones.

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.