致命错误C1083:无法打开包含文件:“Hoa.h”:没有这样的文件或目录

问题描述:

这里是我的代码,它是给上面提到的错误在第3行...致命错误C1083:无法打开包含文件:“Hoa.h”:没有这样的文件或目录

ambisonic_3d.h

#ifndef __DEF_HOA_3D_AMBISONIC__ 
#define __DEF_HOA_3D_AMBISONIC__ 

#include "Hoa.h" 
//! The 3D ambisonic classes. 
/** 
All the 3D ambisonic and planewaves classes will be part of this namespace 
*/ 
namespace Hoa3D 
{ 
    //! The ambisonic class. 
    /** The ambisonics classes inherit from this classe. It computes the number of harmonics depending of the decomposition order and sorts the arguments and the bands of the harmonics in arrays. 
    */ 
    class Ambisonic 
    { 
    protected: 
     unsigned int m_order; 
     unsigned int m_number_of_harmonics; 
     unsigned int* m_harmonics_degrees; 
     int*   m_harmonics_orders; 

    public: 

     //! The ambisonic constructor. 
     /** The ambisonic constructor allocates and initializes the generale member values depending of a decomposition order. The order must be at least 1. 

      @param  order The order. 
     */ 
     Ambisonic(unsigned int order); 

     //! The ambisonic destructor. 
     /** The ambisonic destructor free the memory. 
     */ 
     ~Ambisonic(); 

     //! Retrieve the decomposition order. 
     /** Retrieve the decomposition order of an ambisonic class. 
     */ 
     inline unsigned int getDecompositionOrder() const {return m_order;}; 

     //! Retrieve the number of harmonics. 
     /** Retrieve the number of harmonics of an ambisonic class. 
     */ 
     inline unsigned int getNumberOfHarmonics() const {return m_number_of_harmonics;}; 

     //! Retrieve the order of an harmonic. 
     /** The order of an harmonic is in the range -degree to degree. The harmonics are sorted by their bands, from 0 to the decomposition order. In each band contains 2 * band + 1 harmonics, sorted by their arguments in the range -band to band. The harmonic input and output arrays in process method of ambisonic classes must have this configuration. 
      For the first bands, the harmonics arrangement is h[0, 0] h[1, 0] h[1, -1] h[1, 1] h[2, 0] h[2, -1] h[2, 1] h[2, -2] h[2, 2] etc. 
      with h[band, argument]. 

      @param  index The global index of an harmonic. 
      @return The method returns the argument of the harmonic if the harmonic exists, otherwise the function generates an error. 
      @see  getHarmonicDegree() 
      @see  getHarmonicName() 
     */ 
     inline int getHarmonicOrder(const unsigned int index) const 
     { 
      assert(index < m_number_of_harmonics); 
      return m_harmonics_orders[index]; 
     }; 

     //! Retrieve the degree of an harmonic. 
     /** The degree of the harmonics are in the range 0 to the decomposition order. Each degree contains 2 * degree + 1 harmonics in the range -degree to degree. The harmonic input and output arrays in process method of ambisonic classes must have this configuration. 
      For the first bands, the harmonics arrangement is h[0, 0] h[1, 0] h[1, -1] h[1, 1] h[2, 0] h[2, -1] h[2, 1] h[2, -2] h[2, 2] etc. 
      with h[band, argument]. 

      @param  index The global index of an harmonic. 
      @return The method returns the band of the harmonic if the harmonic exists, otherwise the function generates an error. 
      @see  getHarmonicOrder() 
      @see  getHarmonicName() 
     */ 
     inline unsigned int getHarmonicDegree(const unsigned int index) const 
     { 
      assert(index < m_number_of_harmonics); 
      return m_harmonics_degrees[index]; 
     }; 

     //! Retrieve the index of an harmonic. 
     /** The degree of the harmonics are in the range 0 to the decomposition order. Each degree contains 2 * degree + 1 harmonics in the range -degree to degree. The harmonic input and output arrays in process method of ambisonic classes must have this configuration. 
     For the first bands, the harmonics arrangement is h[0, 0] h[1, -1] h[1, 0] h[1, 1] h[2, -2] h[2, -1] h[2, 0] h[2, 1] h[2, 2] etc. 
     with h[degree, order]. 

     @param  degree The degree an harmonic. 
     @param  order The order an harmonic. 
     @return The method returns the index of the harmonic if the harmonic exists, otherwise the function generates an error. 
     @see  getHarmonicOrder() 
     @see  getHarmonicName() 
     */ 
     inline unsigned int getHarmonicIndex(const unsigned int degree, const int order) const 
     { 
      assert(degree <= m_order); 
      return degree * degree + degree + order; 
     }; 

     //! Retrieve a name for an harmonic. 
     /** Retrieve a name for an harmonic in a std::string format that will be "harmonic band argument". 

      @param  index The global index of an harmonic. 
      @return The method returns a name for the harmonic that contains its band and its argument if the harmonic exists, otherwise the function generates an error. 
      @see  getHarmonicDegree() 
      @see  getHarmonicOrder() 
     */ 
     inline std::string getHarmonicName(const unsigned int index) const 
     { 
      assert(index < m_number_of_harmonics); 
      return "Harmonic " + int_to_string(getHarmonicDegree(index)) + " " + int_to_string(getHarmonicOrder(index)); 
     }; 
    }; 
} 

#endif 

这是我Hoa.h文件:

#ifndef __DEF_HOA_LIBRARY__ 
#define __DEF_HOA_LIBRARY__ 

namespace Hoa{}; 

#include "HoaDefs.h" 
#include "HoaMath.h" 
#include "HoaUtils.h" 

using namespace Hoa; 

#endif 

视觉工作室日志:

1>------ Build started: Project: ambisonics, Configuration: Debug Win32 ------ 
1>Compiling... 
1>Decoder_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Encoder_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Map_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Meter_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\planewaves_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Optim_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Planewaves_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\planewaves_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Rotate_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Scope_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Vector_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\planewaves_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Wider_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Ambisonic_3D.cpp 
1>f:\jayakar\tojayakar\hoa3d\ambisonic_3d.h(10) : fatal error C1083: Cannot open include file: 'Hoa.h': No such file or directory 
1>Generating Code... 
1>Build log was saved at "file://f:\Jayakar\ToJayakar\Ambisonics_module\Debug\BuildLog.htm" 
1>ambisonics - 11 error(s), 0 warning(s) 
+1

'program1.cpp'(和其他'.cpp'文件在日志中)和'Hoa.h'位于同一个目录中吗? – Biffen

+0

是的两者都位于相同的文件夹 –

+1

而'ambisonic_3d.h'和'planewaves_3d.h'? (其实,我在日志中的任何地方都看不到'program1.cpp',是什么让你觉得*该文件首先出错?) – Biffen

在地方的#include的 “Hoa.h” 提供完整的路径和尝试。

+0

感谢venky ...你知道关于缺少stdint.h库的任何信息 –

+4

在源代码中提供绝对路径通常不是一个好主意。最好告诉编译器/链接器它应该查看哪些目录。 – Lundin

+0

谢谢@Lundin ...我已经添加了项目的文件夹路径 –