[CMake] Include paths not being searched?

Michael Wild themiwi at gmail.com
Wed Mar 17 10:48:54 EDT 2010


On 17. Mar, 2010, at 15:32 , David Doria wrote:

> The reason I was looking to check the contents of INCLUDE_DIRECTORIES
> was that when I build my project I am getting errors like this:
> 
> /usr/include/fstream:40:19: error: istream: No such file or directory
> 
> The output of this:
> get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
> message("inc_dirs = ${inc_dirs}")
> 
> indicates that there are several directories on INCLUDE_DIRECTORIES
> that contain istream
> 
> For example, this one:
> /usr/include/c++/4.4.1
> 
> contains the file:
> [doriad at davedesktop 4.4.1]$ cd /usr/include/c++/4.4.1
> [doriad at davedesktop 4.4.1]$ ls is*
> istream
> 
> Does anyone know what else could cause this type of file (it's not
> only istream, but also ostream, cstdio, etc) not to be found?
> 
> Thanks,
> 
> David

Those files should not need to be on the include path since your compiler should know how to find them (after all, they belong to the c++ standard library). Do you happen to use -nostdinc or -nostdinc++ in your compile flags? Also, what is your c++ compiler?

If you do a verbose build ("make VERBOSE=1"), what do you see on the compile line?

Michael



More information about the CMake mailing list