sal.h不包括在Path中的时间

sal.h not including when it is in Path

本文关键字:时间 Path 不包括 sal      更新时间:2023-10-16

我正在将DirectSound实现到一个程序中,但它需要dsound.h,而dsound.h需要sal.h,无论出于什么原因,我都很难让g++识别出我sal.h,它在路径文件中,我甚至可以键入直接命令sal.h,命令提示符将打开sal.h。但当我使用编译时

g++-3 World.cpp -c

我得到

dsound.h:13:17: sal.h: No such file or directory.

由于缺少sal.h,dsound.h出现了数千个错误。我只是使用记事本、g++和命令提示符,sal.h需要使用VC++吗?没有DirectSound有什么方法可以使用吗?

以下是我正在编译的代码的开头,以防万一:

#include "WorldEntity.h"
#include "MBox.h"
#include <D3D9.h>
#include <d3dx9.h>
#include <string>
#include <sstream>
#define _USE_MATH_DEFINES
#include <math.h>
#define KEYDOWN(vk_code)((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code)((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
using namespace std;
World::World()
{
//Etc

以下是WorldEntity.h的开头,它是包含dsound.h的包含文件:

#ifndef WORLDENTITY_H
#define WORLDENTITY_H
class Entity;
class HUD;
#include "Enums.h"
#include "Object.h"
#include "Inventory.h"
#include "AI.h"
#include "Item.h"
#include "Sector.h"
#include "MBox.h"
#include "Particle.h"
#include "Sprite.h"
#include <windows.h>
#include <windows.h>
#include <mmsystem.h>
#include <mmreg.h>
#include <dsound.h>
#include <string>
#include <D3D9.h>
#include <d3dx9.h>
#include <cstdlib>
#include <ctime>    
using namespace std;
enum FontIndex
{
//Etc

命令路径包含路径。您必须将-I标志添加到GCC中,以告诉它在哪里可以找到头文件:

g++-3 -IC:somepath World.cpp -c