LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-24-2006, 11:29 AM   #1
Hyakutake
Member
 
Registered: Apr 2004
Location: Portugal
Distribution: Slackware
Posts: 154

Rep: Reputation: 19
Need help using OpenAL


Hello all.

I've been messing arround with openal trying to learn a bit of it.
Went to linuxpackages.net and download version 0.0.7 i486 for slack v10 (rating 3).

I'm following this tutorial, well just copy, past and compile to see if every thing goes ok.

To compile I use
Code:
bash-3.1$ gcc teste.cpp -lopenal
but it gives this error
Code:
/tmp/ccg4tEWl.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
Here is the source (part of it)
Code:
#include <stdio.h>
#include <AL/al.h>
#include <AL/alut.h>

int main()
{ALuint Buffer;
 ALuint Source;

// Position of the source sound.
ALfloat SourcePos[] = { 0.0, 0.0, 0.0 };

// Velocity of the source sound.
ALfloat SourceVel[] = { 0.0, 0.0, 0.0 };


// Position of the listener.
ALfloat ListenerPos[] = { 0.0, 0.0, 0.0 };

// Velocity of the listener.
ALfloat ListenerVel[] = { 0.0, 0.0, 0.0 };

// Orientation of the listener. (first 3 elements are "at", second 3 are "up")
ALfloat ListenerOri[] = { 0.0, 0.0, -1.0,  0.0, 1.0, 0.0 };

ALenum format;
ALsizei size;
ALvoid* data;
ALsizei freq;
ALboolean loop;

// Load wav data into a buffer.
alGenBuffers(1, &Buffer);
alutLoadWAVFile("FancyPants.wav", &format, &data, &size, &freq, &loop);
alBufferData(Buffer, format, data, size, freq);
alutUnloadWAV(format, data, size, freq);
The problem starts at alGenBuffers(1, &Buffer)

I'm kinda stuck on this, can anyone help me out?

Thanks in advance.
 
Old 11-24-2006, 11:35 AM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 2,012

Rep: Reputation: 115Reputation: 115
You are using gcc to compile a cpp file. you need to use g++.
 
Old 11-25-2006, 08:00 AM   #3
Hyakutake
Member
 
Registered: Apr 2004
Location: Portugal
Distribution: Slackware
Posts: 154

Original Poster
Rep: Reputation: 19
Hi tuxdev, thanks for your reply.

Thank you it worked. Should of thought of that before

cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenAL and dmix Belegdol Linux - Software 0 11-01-2005 04:40 AM
OpenAL? hylke Programming 9 07-25-2005 05:49 PM
OpenAL Problems. DarkestHour Linux - Games 1 12-01-2004 09:08 AM
Threads and OpenAL clb Programming 4 11-14-2004 02:04 PM
OpenAL Installation Help Little_Devil Linux - Software 0 08-08-2002 02:58 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration