Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Crash when trying to play (gcc 4.8.1, win32)

xorus
Registered User
Quote
2014-01-07 11:47:12

Hello, I am trying to use the irrKlang library but it crashes everytime it starts.

Here is my code :

 include <iostream>
include <irrKlang.h>
pragma comment(lib, "irrKlang.lib") // link with irrKlang.dll

using namespace std;

//...

void Test() {
std::cout << "Test() start" << std::endl;

irrklang::ISoundEngine* engine = irrklang::createIrrKlangDevice();

if (!engine)
cout << "it will fail" << endl;

cout << "Engine memory adress : " << &engine << endl;

engine->play2D("test.ogg", true);

cout << "Sound playing" << endl;

cin.get();

engine->drop(); // delete engine

cout << "The end" << endl;
}


The function is called from the main. I get on the output :
Test() start
irrKlang sound library version 1.4.0
Loaded plugin: ikpmp3.dll
Using DirectSound8 driver
Engine memory adress : 0x28fed8


And then the program crashed.
I compile using the command :
g++ --std=c++11 -o projet.exe main.cxx audio.cxx -lirrKlang


What am I doing wrong ?

Windows VS13 debugger (I don't use it to code) says : "Unhandled exception 0x61962056 (irrKlang.dll) in projet.exe : 0xC0000005: Access Violation when reading location 0x00000001" ("Exception non gérée à 0x61962056 (irrKlang.dll) dans projet.exe : 0xC0000005 : Violation d'accès lors de la lecture de l'emplacement 0x00000001.")

Thanks for helping, xorus.


erik
Registered User
Quote
2014-01-07 12:31:01

Use "irrKlang for MingW gcc 4.7" instead, you can get this on the download page. This should fix it.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internation?l" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact