Menu

Resolving multiple #include locations

2010-04-01
2013-05-28
  • Rowan Sylvester-Bradley

    If MCPP has several locations from which to include files with the #include "filename" command (maybe because you've specified an -I option), and you ask to include a file which exists in more than one of these locations, what does MCPP do? Does it include them all, or just one? If one, which one does it choose? Or does it throw an error?

    Thanks - Rowan

     
  • Rowan Sylvester-Bradley

    By a combination of reading the manual and experimentation I think I've now worked this out. I had to specify the -I1 option as well as specifying my include directories with -I <path> to get it to do what I wanted (which was always to search for the file in the current directory first, even if the file was included by another include file elsewhere, then to use the directories in the order specified by -I <path> options).

    Thanks - Rowan

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.