09202024

Last update2016/05/28 14:38

Back 現在地: Home パートナー Strategic Test パートナー Atollic 1.ビルドの設定がどのようにC/C++ Editorで反映されますか?

1.ビルドの設定がどのようにC/C++ Editorで反映されますか?

1.ビルドの設定がどのようにC/C++ Editorで反映されますか?

A common question raised by TrueSTUDIO users concerns active build configuration and its reflection in the C/C++ editor. More explicitly this may concern symbols only valid for one of the different build configurations in a project. Let us take a look at a code example:

#ifdef RELEASE
  #include "release_cfg.h"
#elseif DEBUG
  #include "debug_cfg.h"
#endif

Lets say that RELEASE is the DEFAULT build configuration!

DEBUG is as symbol only valid when active build configuration is:  DEBUG

RELEASE is as symbol only valid when active build configuration is:  RELEASE

When switching build configuration from RELEASE (default) to DEBUG, the C/C++ Editor will still gray out '#include "debug_cfg.h"', 'while "#include release_cfg.h"' looks to be active. The build output itself will however reflect the active build configuration.

Users experienced with CDT in an Eclipse-based IDE most likely recognise this default behaviour, however it may seem a bit odd to new users. If user rather would like to have the C/C++ Editor reflecting the actual active build configuration, this can be set at project level in the project properties.

  1. Go to your project properties.
  2. Branch to: C/C++ General --> Indexer
  3. Check "Enable Project specific settings"
  4. Switch ro radio button "Use active build configuration"

C/C++ Editor Indexer settings

Your C/C++ Editor should now reflect the active build configuration, which may be more intuitive for some TrueSTUDIO users.