Jump to content
  • Advertisement
Sign in to follow this  
Greg K

DirectMusic and Dev-C++

This topic is 4948 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am having some trouble getting DirectMusic up and running with Dev-C++. I have downloaded the dx stuff for Dev-C++ but it is giving me some compile time errors.

#define INITGUID
#include <dmusici.h>
#include <stdio.h>
#include "AudioManager.h"


#define ErrIfFailed( func, msg ) if( FAILED(func) ) printf("%s\n", msg)

AudioManager::AudioManager()
{
 	ErrIfFailed(CoInitialize( NULL ), "Could not initialize COM");
}

AudioManager::~AudioManager()
{
	CoUninitialize();
}

void AudioManager::Create(HWND hWnd)
{

	ErrIfFailed(CoCreateInstance(CLSID_DirectMusicPerformance, NULL, CLSCTX_INPROC, IID_IDirectMusicPerformance8, (void**)&Performance), "Could not create DirectMusicPerformance");
	Performance->InitAudio(NULL, NULL, hWnd, DMUS_APATH_SHARED_STEREOPLUSREVERB, 128, DMUS_AUDIOF_ALL, NULL);

	ErrIfFailed(CoCreateInstance(CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, IID_IDirectMusicLoader8, (void**)&Loader), "Could not create DirectMusicLoader");	


}

void AudioManager::Destroy()
{
	Performance->CloseDown();
}


#ifndef AUDIOMANAGER_H
#define AUDIOMANAGER_H


#include <DMusicc.h>

class AudioManager
{
private:
	IDirectMusicPerformance8* Performance;
	IDirectMusicLoader8* Loader;


public:
	AudioManager();
	~AudioManager();
	void Create(HWND hWnd);
	void Destroy();

};

#endif

gives me: Compiler: Default compiler Building Makefile: "E:\source\libAudio\Makefile.win" Executing make... make.exe -f "E:\source\libAudio\Makefile.win" all g++.exe -c AudioManager.cpp -o AudioManager.o -I"E:/Programs/Dev-Cpp/include/c++" -I"E:/Programs/Dev-Cpp/include/c++/mingw32" -I"E:/Programs/Dev-Cpp/include/c++/backward" -I"E:/Programs/Dev-Cpp/include" In file included from E:/Programs/Dev-Cpp/include/dmusicc.h:21, from E:/Programs/Dev-Cpp/include/dmusici.h:19, from AudioManager.cpp:2: E:/Programs/Dev-Cpp/include/dmdls.h:23:1: warning: "MAKEFOURCC" redefined In file included from E:/Programs/Dev-Cpp/include/windows.h:80, from E:/Programs/Dev-Cpp/include/dmusici.h:13, from AudioManager.cpp:2: E:/Programs/Dev-Cpp/include/mmsystem.h:24:1: warning: this is the location of the previous definition In file included from E:/Programs/Dev-Cpp/include/dmusicc.h:21, from E:/Programs/Dev-Cpp/include/dmusici.h:19, from AudioManager.cpp:2: E:/Programs/Dev-Cpp/include/dmdls.h:81: declaration of `WLOOP _DMUS_REGION::WLOOP[1]' E:/Programs/Dev-Cpp/include/dls1.h:264: changes meaning of `WLOOP' from ` typedef struct _rloop WLOOP' make.exe: *** [AudioManager.o] Error 1 Execution terminated

Share this post


Link to post
Share on other sites
Advertisement
I'm not sure, but I don't think you want to be including dmusicc.h in your header file. It will get included by dmusici.h AFTER including mmsystem.h. That should take care of the issues. (I think.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!