visual studio 2010 - C++ #include relative path -


is possible relative path correct, nevertheless compilation error:

2>src\wfbuilderapp.cpp(15): fatal error c1083: cannot open include file: '../project/include/public/core/paths.h': no such file or directory 

in particular, possible error occurs not because path wrong, because included file "does not permit" have binding between files ? file including , included file located in same solution, in subfolders of folders located in different projects.

here questions #include:

  • can include file long path correct , included file in same solution ?
  • can include .cpp file ?
  • do need include both .cpp , .h files ?

can include file long path correct , included file in same solution ?

if path correct, yes. being in same solution has no effect on include. compiler file in places it's told (adding file solution doesn't modify places).

the proper way adding path additional include directories in project properties.

can include .cpp file ?

yes, shouldn't, unless it's bulk builds.

do need include both .cpp , .h files ?

no. can, don't need to. need include headers, if full definition of defined in header needed. cpp files, see previous answer.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -