Adding header files to eclipse build path for C++

前端 未结 2 1531
误落风尘
误落风尘 2020-12-17 21:09

I\'m trying to use this: http://www.minixml.org/index.php

I\'d like to get these includes to work on Eclipse for Windows.

Can anybody help me?

相关标签:
2条回答
  • 2020-12-17 21:43

    Left-click your project and choose Properties, then go to the following section: C/C++ General, and then Paths and Symbols, then select Includes tab, in Languages list choose GNU C++ (or whichever toolchain is your current). Now you can see Add... button to the very right, click it and provide a path to the directory which contains includes, for example: D:\Libraries\MiniXML\include. Don't forget to check the Add to all configurations checkbox. That's it, we are done.

    0 讨论(0)
  • 2020-12-17 21:45

    As @Alexander-Shukaev pointed out, adding Include Path (-I) is done using PropertiesC/C++ GeneralPaths and SymbolsIncludes.

    OTH, adding Include File (-include, AKA 'forced include') is done using PropertiesC/C++ GeneralPaths and SymbolsIncludes Files.

    Note #1: as of Eclipse Oxygen, there is another way to do that - PropertiesC/C++ GeneralPreprocessor Include Paths, Macros etc.CDT User Settings EntriesAddInclude File (use the drop-down box). Not clear way one would want either.

    Note #2: use of variables helps to set configuration specific settings. For example - ${ProjDirPath}/${ConfigName}/config.h

    0 讨论(0)
提交回复
热议问题