Eclipse CDT: How to reference 3rd party includes via a Relative path

前端 未结 4 1961
盖世英雄少女心
盖世英雄少女心 2020-12-31 06:31

I\'m new to Eclipse-CDT, setting up a new project for the first time. I\'m trying to reference Boost without hardcoding an absolute path.

I\'ve put boost in

4条回答
  •  醉梦人生
    2020-12-31 07:22

    I am using Eclipse Luna and found the accepted answer to be no longer accurate. After a bit of head scratching, it seems that a couple of changes have happened in the past few years (at least, this is what happened on my system):

    • Eclipse no longer expands variables when you click "OK" if you have not ticked "Is workspace path".
    • Eclipse cannot find any paths that are relative to the workspace unless they actually refer to projects in the workspace. Any paths that cannot be found by Eclipse will not be added to the build command line with a -I or other relevant switch

    For this to work, therefore, I had to enter ${ProjDirPath}/../whatever as a non workspace-relative path, and the variable is not expanded until compile time.

提交回复
热议问题