1.20. Specifying a Command-Line Option from Your IDE
Problem
You want to pass a command-line option to your compiler or linker, but it doesn’t correspond to any of the project settings available through your IDE.
Solution
Many IDEs provide a way to pass command-line options directly to the compiler or linker. This is summarized in Table 1-18 and Table 1-19.
Table 1-18. Specifying a compiler option from your IDE
|
IDE |
Configuration |
|---|---|
|
Visual C++ |
From your project’s property pages, go to Configuration Properties → C/C++ → Command Line and enter the option under Additional options. |
|
CodeWarrior |
n/a |
|
C++Builder |
n/a |
|
Dev-C++ |
From Project Options, select Parameters and enter the option under C++ Compiler. |
Table 1-19. Specifying a linker option from your IDE
|
IDE |
Configuration |
|---|---|
|
Visual C++ |
From your project’s property pages, go to Configuration Properties → Linker → Command Line and enter the option under Additional options. |
|
Metrowerks |
n/a |
|
C++Builder |
n/a |
|
Dev-C++ |
From Project Options, select Parameters and enter the option under Linker. |
Discussion
Visual C++ provides extensive configuration options through its graphical interface, but it also allows you to specify command-line options explicitly. CodeWarrior and C++Builder do not allow you to set command-line options explicitly, but this is generally not a problem, since like Visual C++ they both provide extensive configuration options through their graphical interfaces. Some IDEs, on the other hand, provide little means to configure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access