Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: -include header file on command line



Permlink Replies: 1 - Last Post: May 26, 2016 11:03 AM Last Post By: Remy Lebeau (Te... Threads: [ Previous | Next ]
Sten Larsson

Posts: 8
Registered: 10/11/02
-include header file on command line
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 26, 2016 12:54 AM
Using GCC, I can include a file on the command line:

-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.
https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html

Also for Microsoft
https://msdn.microsoft.com/en-us/library/8c5ztk84.aspx

And also same for CLang.

However, I fail to find this for BCC32 and also not in the C++ Builder GUI (RAD Studio). Did I miss it, or is it not there?

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: -include header file on command line
Click to report abuse...   Click to reply to this thread Reply
  Posted: May 26, 2016 11:03 AM   in response to: Sten Larsson in response to: Sten Larsson
Sten wrote:

However, I fail to find this for BCC32 and also not in the C++
Builder GUI (RAD Studio). Did I miss it, or is it not there?

The classic BCC32 compiler does not have an option to include specific header
files on the command line, only to add folders to the include files search
path (-I, same as gcc's).

The new BCC32C compiler, BCC64, and the mobile compilers are all based on
CLang, so you should be able to use any command-line parameters that CLang
supports. In the IDE, there is an "Additional commands to pass to the compiler"
option available in the "C++ Compiler > Advanced" section.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02